From: Nick Porter Date: Thu, 25 Aug 2022 15:01:49 +0000 (+0100) Subject: Make fr_internal_decode_list_dbuff simply decode as is X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d1b9243bd2e0984db514e8183d40de39b52ebf7;p=thirdparty%2Ffreeradius-server.git Make fr_internal_decode_list_dbuff simply decode as is Any manipulation of the retrieved attributes should be done by the caller --- diff --git a/src/protocols/internal/decode.c b/src/protocols/internal/decode.c index dca5766de88..d5fde8448fc 100644 --- a/src/protocols/internal/decode.c +++ b/src/protocols/internal/decode.c @@ -362,8 +362,6 @@ ssize_t fr_internal_decode_pair_dbuff(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_d return fr_dbuff_set(dbuff, &work_dbuff); } -static fr_dict_attr_t const *attr_protocol_encapsulation; - /** Retrieve all pairs from the dbuff * * @param ctx to create new pairs in @@ -379,8 +377,6 @@ ssize_t fr_internal_decode_list_dbuff(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_d fr_dbuff_t *dbuff, void *decode_ctx) { ssize_t ret, len = 0; - fr_pair_t *vp = NULL; - fr_pair_t *child, *grandchild; while (fr_dbuff_remaining(dbuff)) { ret = fr_internal_decode_pair_dbuff(ctx, out, parent, dbuff, decode_ctx); @@ -388,27 +384,6 @@ ssize_t fr_internal_decode_list_dbuff(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_d len += ret; } - if (!attr_protocol_encapsulation) { - attr_protocol_encapsulation = fr_dict_attr_by_name(NULL, fr_dict_root(fr_dict_internal()), "Protocol-Encapsulation"); - } - - /* - * Move any attributes inside Protocol-Encapsulation and it's child protocol - * attributes to the parent list - */ - while ((vp = fr_pair_find_by_da(out, NULL, attr_protocol_encapsulation))) { - while ((child = fr_pair_list_head(&vp->children))) { - fr_pair_remove(&vp->children, child); - while ((grandchild = fr_pair_list_head(&child->children))) { - fr_pair_remove(&child->children, grandchild); - fr_pair_steal_append(ctx, out, grandchild); - } - talloc_free(child); - } - fr_pair_remove(out, vp); - talloc_free(vp); - } - return len; }