need some insight in udhcp structures size

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Thu Nov 22 17:10:09 UTC 2007


I'm working with bb-1.8.1 and trying to port some patches from an old
1.1.3.

I'm trying to get udhcpc to cope with some buggy dhcp-server builtin a
'3Com OfficeConnect Remote 812 ADSL Router' which insists on sending
packets 28 bytes larger than the 576 udhcpc expects, and which udhcpc
drops with the same "bogus packet, option fields too long" message, in
several places.

One of our customers (who presumally bought a large quantity of those
end-of-life routers) considers udhcpc is at fault, as the routers
"work fine with windos".  I was asked, to fix the udhcpc "problem".
I'm not too happy with the old patch and I'm trying to find an
acceptable way to handle the above mentioned "problem".

I find a few magic numbers around in code (576, 308, 128, 64) related
to the 'dhcpMessage' and 'udp_dhcp_packet' structures.  And, of
course, the function with this interesting name:

  BUG_sizeof_struct_udp_dhcp_packet_must_be_576		(in packet.c)


Can anyone shed some light on this?
Why all those hard coded numbers?
Am I on the right track?
Would an attempt to extend the packet size to accomodate the buggy
dhcp-server be undesirable in any way?


Cheers,

-- 
Cristian



More information about the busybox mailing list