busybox/networking/udhcp
Russell Senior 1c461df70a udhcpc: ignore zero-length DHCP options
Discovered that the DHCP server on a TrendNet router (unknown model)
provides a zero-length option 12 (Host Name) in the DHCP ACK message. This
has the effect of causing udhcpc to drop the rest of the options, including
option 51 (IP Address Lease Time), 3 (Router), and 6 (Domain Name Server),
most importantly leaving the OpenWrt device with no default gateway.

The TrendNet behavior violates RFC 2132, which in Section 3.14 declares that
option 12 has a minimum length of 1 octet. It is perhaps not a cosmic coincidence
that I found this behavior on Pi Day.

This patch allows zero length options without bailing out, by simply skipping them.

function                                             old     new   delta
udhcp_scan_options                                   183     172     -11

Signed-off-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-03-16 11:40:19 +01:00
..
arpping.c
common.c udhcpc: ignore zero-length DHCP options 2021-03-16 11:40:19 +01:00
common.h
Config.src udhcpc: Add support to change default interface name 2021-01-01 19:08:28 +01:00
d6_common.h udhcpc6: code shrink - sending functions do not need ifindex parameter 2020-12-15 21:55:15 +01:00
d6_dhcpc.c udhcp: reuse strings 2021-02-21 16:32:07 +01:00
d6_packet.c udhcpc6: code shrink - sending functions do not need ifindex parameter 2020-12-15 21:55:15 +01:00
d6_socket.c
dhcpc.c udhcp: reuse strings 2021-02-21 16:32:07 +01:00
dhcpc.h
dhcpd.c udhcp: reuse strings 2021-02-21 16:32:07 +01:00
dhcpd.h
dhcprelay.c
domain_codec.c
dumpleases.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
Kbuild.src
packet.c
signalpipe.c
socket.c