[haiku-development] Re: haiku-development Digest V3 #330

  • From: Romain <romain.haiku@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 19 Nov 2009 18:58:16 +0100

>Hm, I found the following:
>
>http://tools.ietf.org/html/rfc2131 Page 24:
>
>"A client that cannot receive unicast IP datagrams until its protocol
>software has been configured with an IP address SHOULD set the
>BROADCAST bit in the 'flags' field to 1 in any DHCPDISCOVER or
>DHCPREQUEST messages that client sends.  The BROADCAST bit will
>provide a hint to the DHCP server and BOOTP relay agent to broadcast
>any messages to the client on the client's subnet.  A client that can
>receive unicast IP datagrams before its protocol software has been
>configured SHOULD clear the BROADCAST bit to 0."
>
>Which flags do they mean? Looks like Dicover requests from my tcpdump
have
>no flags set:
>
>Could it be the source of problem?

This is the 2 bytes field of the dhcp msg as shown on page8 of the
rfc2131.
Its value must be set to 0x8000, defined as DHCP_FLAG_BROADCAST in
DHCPClient.cpp:140.

I guest we just need to set the "flag" field of "dhcp_message" to this
value in the DHCP_DISCOVER case of _PrepareMessage (DHCPClient.cpp:737). We
can add a SetFlag method to the dhcp_message class.
Several dhcp clients I know always set this flag. We can also be smarter
and set it only if we do not have an ip address yet.

In any case, if this is the origin of the problem it should not work with
any ethernet driver.

Romain.

Other related posts:

  • » [haiku-development] Re: haiku-development Digest V3 #330 - Romain