diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-07-01 17:05:11 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-07-01 22:50:39 +0200 |
commit | 12256b84a540434485b16433f83aa23928405560 (patch) | |
tree | e1ef59c861d62e6527ebe87f6527142f18cfef8d /zebra/zebra_nhg.c | |
parent | babeld: Drop in_prefix() function (diff) | |
download | frr-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 '')
-rw-r--r-- | zebra/zebra_nhg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 3535bffd5..cfd4ccf81 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -2049,7 +2049,7 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe, } if (top - && ((top->family == AF_INET && top->prefixlen == 32 + && ((top->family == AF_INET && top->prefixlen == IPV4_MAX_BITLEN && nexthop->gate.ipv4.s_addr == top->u.prefix4.s_addr) || (top->family == AF_INET6 && top->prefixlen == IPV6_MAX_BITLEN && memcmp(&nexthop->gate.ipv6, &top->u.prefix6, 16) @@ -2151,7 +2151,8 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe, * host route. */ if (prefix_same(&rn->p, top)) - if (((afi == AFI_IP) && (rn->p.prefixlen != 32)) + if (((afi == AFI_IP) + && (rn->p.prefixlen != IPV4_MAX_BITLEN)) || ((afi == AFI_IP6) && (rn->p.prefixlen != IPV6_MAX_BITLEN))) { if (IS_ZEBRA_DEBUG_RIB_DETAILED) |