]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
IPv6 addresses should have a 128 prefix, too
authorAlan T. DeKok <aland@freeradius.org>
Fri, 13 Dec 2024 15:17:53 +0000 (10:17 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 13 Dec 2024 15:17:53 +0000 (10:17 -0500)
src/lib/util/cbor.c

index a648d3f930fc7a58464b3646b672f972ed40c02c..ef36effa0f2315d21f29938023152dced61e9336 100644 (file)
@@ -710,8 +710,8 @@ static ssize_t cbor_decode_ipv6_addr(UNUSED TALLOC_CTX *ctx, fr_value_box_t *vb,
        slen = cbor_decode_count(&value, CBOR_INTEGER, &work_dbuff);
        if (slen <= 0) return_slen;
 
-       if (value > 128) {
-               fr_strerror_printf("Invalid IPv6 interface - expected prefix <= 128 got %" PRIu64, value);
+       if (value != 128) {
+               fr_strerror_printf("Invalid IPv6 address - expected prefix = 128 got %" PRIu64, value);
                return -fr_dbuff_used(&work_dbuff);
        }