summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-07-02 07:52:22 -0400
committerGitHub <noreply@github.com>2021-07-02 07:52:22 -0400
commit0a9fcd96d186bf2bbbb7a9148ced1eeadfbd5e03 (patch)
treecc8582fd1ca1b095f1a917b8c5077ccc392cb114 /lib/command_match.c
parent1e15822698cc62d0c30069688b5b2054acb21722 (diff)
parent8643c2e5f7b5541f136a3dfff5abe5b537159442 (diff)
Merge pull request #8970 from ton31337/fix/use_IPV6_MAX_BITLEN
*: Do not use 32/128 numbers for prefixlen
Diffstat (limited to 'lib/command_match.c')
-rw-r--r--lib/command_match.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index e9e8466ffd..5703510148 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -813,7 +813,7 @@ static enum match_type match_ipv4_prefix(const char *str)
str++;
}
- if (atoi(sp) > 32)
+ if (atoi(sp) > IPV4_MAX_BITLEN)
return no_match;
return exact_match;
@@ -948,7 +948,7 @@ static enum match_type match_ipv6_prefix(const char *str, bool prefix)
if (*endptr != '\0')
return no_match;
- if (mask < 0 || mask > 128)
+ if (mask < 0 || mask > IPV6_MAX_BITLEN)
return no_match;
return exact_match;