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 libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
common.c udhcpc: ignore zero-length DHCP options 2021-03-16 11:40:19 +01:00
common.h udhcp: bind to device even for ucast packets 2020-12-15 21:44:21 +01:00
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 libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
dhcpc.c udhcp: reuse strings 2021-02-21 16:32:07 +01:00
dhcpc.h udhcpc: add support for long options 2020-08-13 16:48:07 +02:00
dhcpd.c udhcp: reuse strings 2021-02-21 16:32:07 +01:00
dhcpd.h udhcp: rename server_config to server_data 2019-05-30 16:23:34 +02:00
dhcprelay.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
domain_codec.c domain_codec: optimize dname_dec and convert_dname 2020-07-12 21:19:13 +02:00
dumpleases.c libbb: introduce and use fputs_stdout 2021-02-03 20:52:40 +01:00
Kbuild.src fix breakage found by mass one-applet builds 2016-12-23 02:42:26 +01:00
packet.c udhcp: bind to device even for ucast packets 2020-12-15 21:44:21 +01:00
signalpipe.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00
socket.c libbb: reduce the overhead of single parameter bb_error_msg() calls 2019-07-02 11:35:03 +02:00