summaryrefslogtreecommitdiffstats
path: root/bgpd/rfapi
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 16:53:21 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 16:53:21 +0200
commit13ccce6e7e5b6f7801910fca53c4c45502bf6213 (patch)
tree1137ab12737b73f976df3df678ab826a8d335c71 /bgpd/rfapi
parent*: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLEN (diff)
downloadfrr-13ccce6e7e5b6f7801910fca53c4c45502bf6213.tar.xz
frr-13ccce6e7e5b6f7801910fca53c4c45502bf6213.zip
*: Convert numeric 128 into IPV6_MAX_BITLEN for prefixlen
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/rfapi')
-rw-r--r--bgpd/rfapi/rfapi.c4
-rw-r--r--bgpd/rfapi/rfapi_private.h2
-rw-r--r--bgpd/rfapi/rfapi_vty.c4
-rw-r--r--bgpd/rfapi/vnc_export_bgp.c2
-rw-r--r--bgpd/rfapi/vnc_import_bgp.c6
-rw-r--r--bgpd/rfapi/vnc_zebra.c5
6 files changed, 12 insertions, 11 deletions
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c
index f89ef7b0d..814fc8e3f 100644
--- a/bgpd/rfapi/rfapi.c
+++ b/bgpd/rfapi/rfapi.c
@@ -1615,7 +1615,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target,
if (target->addr_family == AF_INET) {
rprefix.length = 32;
} else {
- rprefix.length = 128;
+ rprefix.length = IPV6_MAX_BITLEN;
}
pNHE = rfapiEthRouteTable2NextHopList(
@@ -1692,7 +1692,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target,
if (target->addr_family == AF_INET) {
rprefix.length = 32;
} else {
- rprefix.length = 128;
+ rprefix.length = IPV6_MAX_BITLEN;
}
pNHE = rfapiEthRouteNode2NextHopList(
diff --git a/bgpd/rfapi/rfapi_private.h b/bgpd/rfapi/rfapi_private.h
index e7825e8bf..2451298ed 100644
--- a/bgpd/rfapi/rfapi_private.h
+++ b/bgpd/rfapi/rfapi_private.h
@@ -269,7 +269,7 @@ struct rfapi {
(((prefix)->family == AF_INET) \
? ((prefix)->prefixlen == 32) \
: (((prefix)->family == AF_INET6) \
- ? ((prefix)->prefixlen == 128) \
+ ? ((prefix)->prefixlen == IPV6_MAX_BITLEN) \
: 0))
extern int rfapi_find_rfd(struct bgp *bgp, struct rfapi_ip_addr *vn_addr,
diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c
index 0c40aeb54..9cf21a7db 100644
--- a/bgpd/rfapi/rfapi_vty.c
+++ b/bgpd/rfapi/rfapi_vty.c
@@ -179,7 +179,7 @@ int rfapiQprefix2Raddr(struct prefix *qprefix, struct rfapi_ip_addr *raddr)
raddr->addr.v4 = qprefix->u.prefix4;
break;
case AF_INET6:
- if (qprefix->prefixlen != 128)
+ if (qprefix->prefixlen != IPV6_MAX_BITLEN)
return -1;
raddr->addr.v6 = qprefix->u.prefix6;
break;
@@ -1741,7 +1741,7 @@ int rfapiCliGetPrefixAddr(struct vty *vty, const char *str, struct prefix *p)
}
break;
case AF_INET6:
- if (p->prefixlen != 128) {
+ if (p->prefixlen != IPV6_MAX_BITLEN) {
vty_out(vty, "Not a host address: \"%s\"%s", str,
HVTYNL);
return CMD_WARNING;
diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c
index f8b8c7d68..dc5d3f73e 100644
--- a/bgpd/rfapi/vnc_export_bgp.c
+++ b/bgpd/rfapi/vnc_export_bgp.c
@@ -600,7 +600,7 @@ encap_attr_export(struct attr *new, struct attr *orig,
orig_nexthop.prefixlen = 32;
orig_nexthop.u.prefix4 = orig->mp_nexthop_global_in;
} else if (orig_nexthop.family == AF_INET6) {
- orig_nexthop.prefixlen = 128;
+ orig_nexthop.prefixlen = IPV6_MAX_BITLEN;
orig_nexthop.u.prefix6 = orig->mp_nexthop_global;
} else {
return -1; /* FAIL - can't compute nexthop */
diff --git a/bgpd/rfapi/vnc_import_bgp.c b/bgpd/rfapi/vnc_import_bgp.c
index b23c1eda7..21fe1fac6 100644
--- a/bgpd/rfapi/vnc_import_bgp.c
+++ b/bgpd/rfapi/vnc_import_bgp.c
@@ -110,7 +110,7 @@ static int is_host_prefix(const struct prefix *p)
case AF_INET:
return (p->prefixlen == 32);
case AF_INET6:
- return (p->prefixlen == 128);
+ return (p->prefixlen == IPV6_MAX_BITLEN);
}
return 0;
}
@@ -1083,7 +1083,7 @@ static void vnc_import_bgp_del_route_mode_plain(struct bgp *bgp,
break;
case AF_INET6:
- if (vn_pfx->prefixlen != 128) {
+ if (vn_pfx->prefixlen != IPV6_MAX_BITLEN) {
vnc_zlog_debug_verbose(
"%s: redist VN plen (%d) != 128, skipping",
__func__, vn_pfx->prefixlen);
@@ -1157,7 +1157,7 @@ static void vnc_import_bgp_del_route_mode_nvegroup(struct bgp *bgp,
break;
case AF_INET6:
- if (vn_pfx->prefixlen != 128) {
+ if (vn_pfx->prefixlen != IPV6_MAX_BITLEN) {
vnc_zlog_debug_verbose(
"%s: redist VN plen (%d) != 128, skipping",
__func__, vn_pfx->prefixlen);
diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c
index b254f11ce..a6a64d30e 100644
--- a/bgpd/rfapi/vnc_zebra.c
+++ b/bgpd/rfapi/vnc_zebra.c
@@ -117,7 +117,8 @@ static void vnc_redistribute_add(struct prefix *p, uint32_t metric,
bgp->rfapi_cfg->rfg_redist->vn_prefix.u.prefix4;
break;
case AF_INET6:
- if (bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen != 128) {
+ if (bgp->rfapi_cfg->rfg_redist->vn_prefix.prefixlen
+ != IPV6_MAX_BITLEN) {
vnc_zlog_debug_verbose(
"%s: redist nve group VN prefix len (%d) != 128, skipping",
__func__,
@@ -161,7 +162,7 @@ static void vnc_redistribute_add(struct prefix *p, uint32_t metric,
}
break;
case AF_INET6:
- if (pfx_un.length != 128) {
+ if (pfx_un.length != IPV6_MAX_BITLEN) {
vnc_zlog_debug_verbose(
"%s: redist nve group UN prefix len (%d) != 128, skipping",
__func__, pfx_un.length);