Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 2024 15:33:37 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 278043] Diskless nfs root BOOTP/DHCP Broken
Message-ID:  <bug-278043-227-nkm2rgLfW3@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-278043-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-278043-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278043

Mark Johnston <markj@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |bz@FreeBSD.org,
                   |                            |glebius@FreeBSD.org,
                   |                            |markj@FreeBSD.org,
                   |                            |tuexen@freebsd.org

--- Comment #2 from Mark Johnston <markj@FreeBSD.org> ---
Indeed, bootpc_call() does this strange thing to ensure that the src addr of
DHCP requests has address 0.0.0.0:

 638                         /* Set netmask to 0.0.0.0 */=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 639                         clear_sinaddr(sin);=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 640                         error =3D ifioctl(bootp_so, SIOCAIFADDR,
(caddr_t)ifra,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 641                             td);=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20
 642                         if (error !=3D 0)=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20
 643                                 panic("%s: SIOCAIFADDR, error=3D%d",
__func__,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 644                                     error);=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 645=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20
 646                         error =3D sosend(bootp_so, (struct sockaddr *)=
 &dst,=20
 647                                        &auio, NULL, NULL, 0, td);=20=
=20=20=20=20=20=20=20=20=20
 648                         if (error !=3D 0)=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20
 649                                 printf("%s: sosend: %d state %08x\n",
__func__,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 650                                     error, (int )bootp_so->so_state);=
=20=20=20=20=20=20
 651=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20
 652                         /* Set netmask to 255.0.0.0 */=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 653                         sin->sin_addr.s_addr =3D htonl(0xff000000);=20=
=20=20=20=20=20=20=20=20=20
 654                         error =3D ifioctl(bootp_so, SIOCAIFADDR,
(caddr_t)ifra,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 655                             td);=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20
 656                         if (error !=3D 0)=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20
 657                                 panic("%s: SIOCAIFADDR, error=3D%d",
__func__,=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
 658                                     error);

The sosend() causes udp_send() to connect the socket, resulting in an error
because the local address is 0.0.0.0.  We don't permit that since INADDR_AN=
Y is
used as a sentinel value in the inpcb layer.  dhclient doesn't have this
problem since it uses BPF to write packets.

Any opinions on how best to fix this?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-278043-227-nkm2rgLfW3>