]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move code to shut up clang scan
authorAlan T. DeKok <aland@freeradius.org>
Fri, 18 Mar 2022 13:16:04 +0000 (09:16 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 18 Mar 2022 13:16:30 +0000 (09:16 -0400)
src/protocols/dhcpv4/decode.c

index f894e882f8b285ebd51c0b89a33eb39f0016008c..3dc89dafe11fe16795fbb5d36674551ff3a1d33f 100644 (file)
@@ -220,6 +220,8 @@ static ssize_t decode_value(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t
                        if (exact && (data_len > 5)) goto raw;
 
                        vp->vp_ip.prefix = *p;
+                       mask = ~(uint32_t) 0;
+                       mask <<= (32 - vp->vp_ip.prefix);
 
                        if (*p > 24) {
                                if (data_len < 5) goto raw;
@@ -249,9 +251,6 @@ static ssize_t decode_value(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t
                                ipaddr = 0;
                        }
 
-                       mask = ~(uint32_t) 0;
-                       mask <<= (32 - vp->vp_ip.prefix);
-
                        vp->vp_ipv4addr = htonl(ipaddr & mask);
                        break;
                }