]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Handle child options being in a fr_pair_list_t in dhcpv6/encode.c
authorNick Porter <nick@portercomputing.co.uk>
Sat, 9 Jan 2021 15:52:50 +0000 (15:52 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
src/protocols/dhcpv6/encode.c

index 18712f9b89970605738747aac0d4962e50ca3e04..371a2b7437f61ccf80a097577bc134545ef1d91a 100644 (file)
@@ -288,18 +288,15 @@ static ssize_t encode_value(fr_dbuff_t *dbuff,
 
        case FR_TYPE_GROUP:
        {
-               fr_pair_list_t child;
                fr_dcursor_t child_cursor;
 
                /*
                 *      Encode the child options.
                 */
-               child = vp->vp_group;
-               if (child) {
+               if (!fr_pair_list_empty(&vp->vp_group)) {
                        (void) fr_dcursor_init(&child_cursor, &vp->vp_group);
 
                        while (fr_dcursor_current(&child_cursor) != NULL) {
-                               child = fr_dcursor_current(&child_cursor);
                                slen = fr_dhcpv6_encode_option(&work_dbuff, &child_cursor, encoder_ctx);
                                if (slen == PAIR_ENCODE_SKIPPED) continue;