]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove dead code. CID #1504044
authorAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 23:50:21 +0000 (19:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 23:50:21 +0000 (19:50 -0400)
src/lib/util/inet.c

index 67616238dc4621f19c76df31d271eebae0d45a77..b805666964804d117ab76f6f9638519c0d9cba90 100644 (file)
@@ -674,7 +674,7 @@ int fr_inet_pton6(fr_ipaddr_t *out, char const *value, ssize_t inlen, bool resol
                 *      Parse scope.
                 */
                prefix = strtoul(p, &eptr, 10);
-               if (prefix > 128) {
+               if (prefix > UINT32_MAX) {
                        fr_strerror_printf("Invalid scope ID \"%s\".  Should be between 0-2^32-1", p);
                        return -1;
                }
@@ -684,11 +684,6 @@ int fr_inet_pton6(fr_ipaddr_t *out, char const *value, ssize_t inlen, bool resol
                        return -1;
                }
 
-               if (prefix > UINT32_MAX) {
-                       fr_strerror_printf("Invalid scope ID \"%s\"", p);
-                       return -1;
-               }
-
                return 0;
        }