summaryrefslogtreecommitdiffstats
path: root/ldpd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 17:05:11 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 22:50:39 +0200
commit12256b84a540434485b16433f83aa23928405560 (patch)
treee1ef59c861d62e6527ebe87f6527142f18cfef8d /ldpd
parentbabeld: Drop in_prefix() function (diff)
downloadfrr-12256b84a540434485b16433f83aa23928405560.tar.xz
frr-12256b84a540434485b16433f83aa23928405560.zip
*: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlen
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'ldpd')
-rw-r--r--ldpd/lde.c4
-rw-r--r--ldpd/util.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c
index 1249db993..2d35d097a 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -751,8 +751,8 @@ lde_update_label(struct fec_node *fn)
/* should we allocate a label for this fec? */
switch (fn->fec.type) {
case FEC_TYPE_IPV4:
- if ((ldeconf->ipv4.flags & F_LDPD_AF_ALLOCHOSTONLY) &&
- fn->fec.u.ipv4.prefixlen != 32)
+ if ((ldeconf->ipv4.flags & F_LDPD_AF_ALLOCHOSTONLY)
+ && fn->fec.u.ipv4.prefixlen != IPV4_MAX_BITLEN)
return (NO_LABEL);
if (lde_acl_check(ldeconf->ipv4.acl_label_allocate_for,
AF_INET, (union ldpd_addr *)&fn->fec.u.ipv4.prefix,
diff --git a/ldpd/util.c b/ldpd/util.c
index ce74e9099..019d846ad 100644
--- a/ldpd/util.c
+++ b/ldpd/util.c
@@ -182,7 +182,7 @@ ldp_prefixcmp(int af, const union ldpd_addr *a, const union ldpd_addr *b,
case AF_INET:
if (prefixlen == 0)
return (0);
- if (prefixlen > 32)
+ if (prefixlen > IPV4_MAX_BITLEN)
fatalx("ldp_prefixcmp: bad IPv4 prefixlen");
mask = htonl(prefixlen2mask(prefixlen));
aa = htonl(a->v4.s_addr) & mask;