From: Nick Porter Date: Tue, 17 Jun 2025 09:22:02 +0000 (+0100) Subject: Walk over DHCPv4 padding option rather than returning NULL X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3f996f;p=thirdparty%2Ffreeradius-server.git Walk over DHCPv4 padding option rather than returning NULL Some clients put padding in the middle of packets - so the option we're looking for may be after the padding. --- diff --git a/src/protocols/dhcpv4/packet.c b/src/protocols/dhcpv4/packet.c index c17c3ec21b..6d0d0d6390 100644 --- a/src/protocols/dhcpv4/packet.c +++ b/src/protocols/dhcpv4/packet.c @@ -48,7 +48,11 @@ uint8_t const *fr_dhcpv4_packet_get_option(dhcp_packet_t const *packet, size_t p data = &packet->options[where]; while (where < size) { - if (data[0] == 0) return NULL; /* padding */ + if (data[0] == 0) { /* padding */ + where++; + data++; + continue; + } if (data[0] == 255) { /* end of options */ if ((field == DHCP_OPTION_FIELD) && (overload & DHCP_FILE_FIELD)) {