From: Alan T. DeKok Date: Thu, 20 Apr 2023 21:54:00 +0000 (-0400) Subject: remove assertion X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d6e1f159b8cb4831ddc96aad3ed2a522d984315;p=thirdparty%2Ffreeradius-server.git remove assertion We need to fix up encode_tlv(), as for RADIUS, it's really "encode TLV contents", and not "encode the entire TLV". The encode_child() function also relies on the encode_value() funtion to handle grouping attributes, which is likely also wrong. The RADIUS encoder / decoder is not only more complex than the other protocols, it was written earlier. i.e. before we cleaned up and clarified the process of encoding packets. --- diff --git a/src/protocols/radius/encode.c b/src/protocols/radius/encode.c index e5c0ad9de5f..41d8bb95591 100644 --- a/src/protocols/radius/encode.c +++ b/src/protocols/radius/encode.c @@ -911,7 +911,6 @@ static ssize_t encode_child(fr_dbuff_t *dbuff, FR_DBUFF_IN_BYTES_RETURN(&work_dbuff, (uint8_t)da_stack->da[depth]->attr, hlen); fr_assert(da_stack->da[depth] != NULL); - fr_assert(fr_type_is_leaf(da_stack->da[depth]->type)); slen = encode_value(&work_dbuff, da_stack, depth, cursor, encode_ctx); if (slen <= 0) return slen;