Is there any convention on where the DHCP message type?

Ted Lemon mellon at fugue.com
Tue May 9 16:12:51 UTC 2006


On Tuesday 09 May 2006 06:44, Ralph Blach wrote:
> It would be very nice if the one could assume the DHCP  message type was
> always the first option after the Magice Cookie.

No, you must not assume that.   DHCP client implementations that make 
assumptions about alignment of options in the option buffer, or placement of 
options in the option buffer, make for really great story telling ("remember 
that client that was so broken because it...?") but not much else.

Parsing through the packet isn't very hard - there's a pretty good cheap 
example of some code to do it in the relay agent options parsing code in 
relay.c.   Or, frankly, you could write it in about five minutes if you put 
your mind to it.   If space in your boot ROM is tight, well, sorry about 
that.   We fixed this in DHCPv6...   :'}


More information about the dhcp-users mailing list