]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't mangle type to octets if the DA is already unknown
authorAlan T. DeKok <aland@freeradius.org>
Sat, 13 Dec 2025 20:56:53 +0000 (15:56 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 13 Dec 2025 21:10:19 +0000 (16:10 -0500)
src/lib/util/dict_unknown.c
src/tests/unit/protocols/cbor/base.txt

index 98351278da1b0e109a207f44c98197c0845c19a8..b3f8fe232c9beaf6d70d889e4e0f6cb2992b10fb 100644 (file)
@@ -350,7 +350,7 @@ fr_dict_attr_t *fr_dict_attr_unknown_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t co
         *      OCTETS.  Similarly, if a GROUP is malformed, then we
         *      have no idea what's inside of it, and we make it OCTETS.
         */
-       switch (type) {
+       if (!da->flags.is_unknown) switch (type) {
        case FR_TYPE_VENDOR:
                fr_assert(da->flags.type_size != 0);
                break;
index 6bf08d8b57922ee51915f7e050f30dcbc62ee945..09766a4e5f890bffd1a0eab710748b6636bff89c 100644 (file)
@@ -72,7 +72,10 @@ match Vendor-Specific = { Nokia-SR = { raw.255 = (time_delta) 3600.5 } }
 #  Otherwise the "3600.5" is interpreted as a bare word / string.
 #
 encode-pair Vendor-Specific = { Nokia-SR = { raw.255 = (time_delta) 3600.5 } }
-match 9f a1 18 1a 81 a1 19 19 7f 81 a1 18 ff 46 33 36 30 30 2e 35 ff
+match 9f a1 18 1a 81 a1 19 19 7f 81 a1 18 ff d9 03 ea a2 01 19 0e 10 28 1a 1d cd 65 00 ff
+
+decode-pair -
+match Vendor-Specific = { Nokia-SR = { raw.255 = (time_delta) 3600.5 } }
 
 #
 #  Zero-length strings and octets
@@ -136,4 +139,4 @@ decode-pair 9f a1 1a 19 a1 82 00 da 00 00 03 ea a2 01 1a be 00 00 00 28 1b 70 a1
 match Invalid attribute number '430014976' - it must be no more than 8 bits in size
 
 count
-match 61
+match 63