[PATCH RFC] udhcpc: pad packets to work around broken routers

Johannes Stezenbach js at sig21.net
Sat Oct 26 20:39:35 UTC 2013


Hi,

On Sat, Oct 26, 2013 at 05:45:02PM +0600, Vladislav Grishenko wrote:
> Hi, have sent here similar patch in August,
> http://lists.busybox.net/pipermail/busybox/2013-August/079727.html
> 
> > We've discovered a number of dhcp servers and relays check minimal dhcp
> > packet size and drops anything less than 300 octets long as per RFC 1542.
> > After commit "b8b72f02 dhcp: truncate packets instead of padding them to
> 574
> > bytes. closes bug 1849" dhcpc/dhcpd could generate packets with size less
> > than 300 bytes (bootp header + options), and under the circumstances above
> > they all will be dropped by that servers/firewalls/relays.
> > Refer patch against master attached.
> 
> From: Vladislav Grishenko <themiron at mail.ru>
> Date: Fri, 30 Aug 2013 13:25:17 +0600
> Subject: [PATCH] dhcp: keep padding packets to 300 bytes as per RFC 1542
> 
> function                                             old     new   delta
> udhcp_send_kernel_packet                             251     272     +21
> udhcp_send_raw_packet                                445     448      +3
> 
> Signed-off-by: Vladislav Grishenko <themiron at mail.ru>

I was momentarily confused about the significance of RFC 1542
for DHCP, but I think you are right.  I checked isc-dhcp-4.2.4
source and it has a similar #define BOOTP_MIN_LEN 300 and
ensures all DHCP package sizes are >= BOOTP_MIN_LEN.

I think your patch should be applied.

Thanks,
Johannes


More information about the busybox mailing list