]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Padding is correctly handled by fr_dhcpv4_decode_option()
authorNick Porter <nick@portercomputing.co.uk>
Fri, 4 Oct 2024 10:11:25 +0000 (11:11 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 4 Oct 2024 10:42:16 +0000 (11:42 +0100)
src/protocols/dhcpv4/packet.c

index bb142c503ae4ff298514bdba616bd522b4892585..c17c3ec21b5d95428725eb0fffda9d54fc668221 100644 (file)
@@ -194,8 +194,6 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data,
                 *      Loop over all the options data
                 */
                while (p < end) {
-                       if (p[0] == 0) break; /* padding */
-
                        len = fr_dhcpv4_decode_option(ctx, &tmp, p, (end - p), packet_ctx);
                        if (len <= 0) {
                        fail:
@@ -227,8 +225,6 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data,
                                p = data + 44;
                                end = p + 64;
                                while (p < end) {
-                                       if (p[0] == 0) break; /* padding */
-
                                        len = fr_dhcpv4_decode_option(ctx, &tmp,
                                                                      p, end - p, packet_ctx);
                                        if (len <= 0) goto fail;
@@ -243,8 +239,6 @@ int fr_dhcpv4_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, uint8_t const *data,
                                p = data + 108;
                                end = p + 128;
                                while (p < end) {
-                                       if (p[0] == 0) break; /* padding */
-
                                        len = fr_dhcpv4_decode_option(ctx, &tmp,
                                                                      p, end - p, packet_ctx);
                                        if (len <= 0) goto fail;