summaryrefslogtreecommitdiffstats
path: root/babeld
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 /babeld
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 'babeld')
-rw-r--r--babeld/kernel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/babeld/kernel.c b/babeld/kernel.c
index e3c76bdd9..3941db8d5 100644
--- a/babeld/kernel.c
+++ b/babeld/kernel.c
@@ -176,11 +176,11 @@ zebra_route(int add, int family, const unsigned char *pref, unsigned short plen,
switch (family) {
case AF_INET:
uchar_to_inaddr(&api_nh->gate.ipv4, gate);
- if (IPV4_ADDR_SAME (&api_nh->gate.ipv4, &quagga_prefix.u.prefix4) &&
- quagga_prefix.prefixlen == 32) {
- api_nh->type = NEXTHOP_TYPE_IFINDEX;
- } else {
- api_nh->type = NEXTHOP_TYPE_IPV4_IFINDEX;
+ if (IPV4_ADDR_SAME(&api_nh->gate.ipv4, &quagga_prefix.u.prefix4)
+ && quagga_prefix.prefixlen == IPV4_MAX_BITLEN) {
+ api_nh->type = NEXTHOP_TYPE_IFINDEX;
+ } else {
+ api_nh->type = NEXTHOP_TYPE_IPV4_IFINDEX;
}
break;
case AF_INET6: