From d6d160a22ac2dd6cb81cdebd2e7251085f3adeb9 Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Wed, 2 Oct 2024 17:07:12 +0100 Subject: [PATCH] Remove DHCPv4 encoder for flat list VSAs --- src/protocols/dhcpv4/encode.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/protocols/dhcpv4/encode.c b/src/protocols/dhcpv4/encode.c index 541edc91f22..852003294d1 100644 --- a/src/protocols/dhcpv4/encode.c +++ b/src/protocols/dhcpv4/encode.c @@ -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); -- 2.47.3