]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove DHCPv4 encoder for flat list VSAs
authorNick Porter <nick@portercomputing.co.uk>
Wed, 2 Oct 2024 16:07:12 +0000 (17:07 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 3 Oct 2024 06:58:09 +0000 (07:58 +0100)
src/protocols/dhcpv4/encode.c

index 541edc91f2278b622c5ad1b44db5806b4a42b386..852003294d11ee18a7b933113c92e1bc1a1ada38 100644 (file)
@@ -620,35 +620,6 @@ static ssize_t encode_vsio(fr_dbuff_t *dbuff,
                return PAIR_ENCODE_FATAL_ERROR;
        }
 
-       /*
-        *      We are at the VSA.  The next entry in the stack is the vendor.  The entry after that is the vendor data.
-        */
-       if (da_stack->da[depth + 1]) {
-               ssize_t len;
-               fr_dcursor_t vsa_cursor;
-
-               if (da_stack->da[depth + 2]) {
-                       return encode_vsio_data(dbuff, da_stack, depth + 2, cursor, encode_ctx);
-               }
-
-               vp = fr_dcursor_current(cursor);
-               fr_assert(vp->vp_type == FR_TYPE_VENDOR);
-
-               /*
-                *      Copied from below.
-                */
-               fr_pair_dcursor_init(&vsa_cursor, &vp->vp_group);
-               work_dbuff = FR_DBUFF(dbuff);
-
-               while ((vp = fr_dcursor_current(&vsa_cursor)) != NULL) {
-                       fr_proto_da_stack_build(da_stack, vp->da);
-                       len = encode_vsio_data(&work_dbuff, da_stack, depth + 2, &vsa_cursor, encode_ctx);
-                       if (len <= 0) return len;
-               }
-
-               goto done;
-       }
-
        vp = fr_dcursor_current(cursor);
        fr_assert(vp->da == da);
 
@@ -690,7 +661,6 @@ static ssize_t encode_vsio(fr_dbuff_t *dbuff,
        /*
         *      Skip over the attribute we just encoded.
         */
-done:
        vp = fr_dcursor_next(cursor);
        fr_proto_da_stack_build(da_stack, vp ? vp->da : NULL);