]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
"encode no data" is allowed
authorAlan T. DeKok <aland@freeradius.org>
Sat, 13 Dec 2025 12:37:18 +0000 (07:37 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 13 Dec 2025 13:38:49 +0000 (08:38 -0500)
src/lib/util/encode.c
src/tests/unit/protocols/radius/foreign.txt

index a76ca0a409315b3a7f1d4faf6b891b843409a4d6..033483b1b3f5bea8f237bd84c195616bc952af1c 100644 (file)
@@ -146,7 +146,7 @@ ssize_t fr_pair_ref_to_network(fr_dbuff_t *dbuff, fr_da_stack_t *da_stack, unsig
         *      The foreign functions don't take a cursor, so we have to update the cursor ourselves.
         */
        slen = proto->encode(&work_dbuff, &vp->vp_group);
-       if (slen <= 0) return slen;
+       if (slen < 0) return slen;
 
        FR_PROTO_HEX_DUMP(fr_dbuff_start(&work_dbuff), fr_dbuff_used(&work_dbuff), "group ref");
 
index ab56efb48e718d21fda0b58e8f7b613660f35598..8fa171003f0b4aadecd70e23eed643d366606c79 100644 (file)
@@ -75,5 +75,8 @@ match 1a 0b 00 00 19 7f 66 05 35 01 01
 decode-pair -
 match Vendor-Specific = { Nokia-SR = { ToServer-Dhcp-Options = { Message-Type = ::Discover } } }
 
+decode-proto 05 ff 00 1e 00 2a 3e 00 c7 00 00 18 13 00 2f 00 00 20 00 00 1a 0a 00 00 19 7f 66 04 21 00
+match Packet-Type = ::Accounting-Response, Packet-Authentication-Vector = 0x002a3e00c700001813002f0000200000, Vendor-Specific = { Nokia-SR = { ToServer-Dhcp-Options = { } } }
+
 count
-match 29
+match 31