[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
system/855: DHCP client broadcast
>Number: 855
>Category: system
>Synopsis: DHCP client reply broadcast
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bugs
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jun 6 11:50:02 MDT 1999
>Last-Modified:
>Originator: Martin Portmann
>Organization:
infinitum AG
>Release: OpenBSD 2.4/2.5
>Environment:
System : OpenBSD 2.5 / OpenBSD 2.4
Architecture: OpenBSD.i386
Machine : i386
>Description:
I was using OpenBSD within a normal network environment
and did not have any problems with the DHCP client
(dhclient). Then I signed up with the local cable
company for internet access. The DHCP client of Windows NT,
Solaris worked fine but OpenBSD did not work out of
the box.
The difference is that the DHCP client requests it's
reply as broadcast. This packet does not reach me (they do
some filtering - because we pay for traffic). This is not
necessary for OpenBSD. Section 4.1 of RFC 1531 states:
Normally, DHCP servers and BOOTP relay agents
attempt to deliver DHCPOFFER, DHCPACK and DHCPNAK
messages directly to the client using unicast delivery.
The IP destination address (in the IP header) is set to
the DHCP 'yiaddr' address and the link-layer destination
address is set to the DHCP 'chaddr' address.
Unfortunately, some client implementations are unable to
receive such unicast IP datagrams until the
implementation has been configured with a valid IP address
(leading to a deadlock in which the client's IP address cannot
be delivered until the client has been configured with an IP
address).
>How-To-Repeat:
Subscribe to internet access by cable modem with www.datazug.ch
and use OpenBSD.
>Fix:
The following patch to OpenBSD 2.4's dhclient.c (CVS version 1.2).
*** dhclient.c.12 Sun Jun 6 19:24:38 1999
--- dhclient.c Sun Jun 6 19:26:11 1999
***************
*** 1375,1381 ****
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = random ();
ip -> client -> packet.secs = 0; /* filled in by send_discover. */
! ip -> client -> packet.flags = htons (BOOTP_BROADCAST); /* XXX */
memset (&(ip -> client -> packet.ciaddr),
0, sizeof ip -> client -> packet.ciaddr);
memset (&(ip -> client -> packet.yiaddr),
--- 1375,1381 ----
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = random ();
ip -> client -> packet.secs = 0; /* filled in by send_discover. */
! ip -> client -> packet.flags = 0;
memset (&(ip -> client -> packet.ciaddr),
0, sizeof ip -> client -> packet.ciaddr);
memset (&(ip -> client -> packet.yiaddr),
***************
*** 1482,1488 ****
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = ip -> client -> xid;
ip -> client -> packet.secs = 0; /* Filled in by send_request. */
! ip -> client -> packet.flags = htons (BOOTP_BROADCAST);
/* If we own the address we're requesting, put it in ciaddr;
otherwise set ciaddr to zero. */
--- 1482,1488 ----
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = ip -> client -> xid;
ip -> client -> packet.secs = 0; /* Filled in by send_request. */
! ip -> client -> packet.flags = 0;
/* If we own the address we're requesting, put it in ciaddr;
otherwise set ciaddr to zero. */
***************
*** 1581,1587 ****
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = ip -> client -> xid;
ip -> client -> packet.secs = 0; /* Filled in by send_request. */
! ip -> client -> packet.flags = htons (BOOTP_BROADCAST);
/* ciaddr must always be zero. */
memset (&ip -> client -> packet.ciaddr, 0,
--- 1581,1587 ----
ip -> client -> packet.hops = 0;
ip -> client -> packet.xid = ip -> client -> xid;
ip -> client -> packet.secs = 0; /* Filled in by send_request. */
! ip -> client -> packet.flags = 0;
/* ciaddr must always be zero. */
memset (&ip -> client -> packet.ciaddr, 0,
>Audit-Trail:
>Unformatted: