[patch] cope with buggy dhcp servers

walter harms wharms at bfs.de
Sat Nov 24 12:52:30 UTC 2007



Cristian Ionescu-Idbohrn wrote:
> On Sat, 24 Nov 2007, Cristian Ionescu-Idbohrn wrote:
> 
>> On Fri, 23 Nov 2007, Cristian Ionescu-Idbohrn wrote:
>>
>>> Still...  This tweak is needed _only_ if the dhcp-server is brain
>>> dead, problem which most clients don't suffer of.

hi Cristian,
   a few comments on you patch:	

   if (end + string[OPT_LEN] + 2 + 1 >= UDHCP_OPTIONS_BUFF_SIZE_MIN) {
 		bb_error_msg("option 0x%02x did not fit into the packet",
 				string[OPT_CODE]);
   you know what packet so you can tell like:

	"broken option 0x%02x causes Option buffer overrun",string[OPT_CODE]);

   or (so people have a change to adjust the buffer, perhaps mention the RFC )
	"DHCPD option 0x%02x violates RFC3397, %d bytes to large",string[OPT_CODE] ,end + string[OPT_LEN] + 2 + 1-UDHCP_OPTIONS_BUFF_SIZE_MIN);
        (calc the suff in advance would be nice :)
    i like this because it says *who* is to blame and *why* is it to blame and *what* size to put into
     UDHCP_OPTIONS_SLACK_FOR_BUGGY_SERVERS


  btw: naming variables:
	UDHCP_OPTIONS_BUFF_SIZE_MIN translates for me into *minimum* buf size.
	(is there an BUF_SIZE_MAX ?)
	any reason not to call it UDHCP_OPTIONS_BUFF_SIZE ?
	

  just my 2 cents,
	walter



More information about the busybox mailing list