summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_network.c9
-rw-r--r--ldpd/labelmapping.c2
-rw-r--r--lib/prefix.h1
-rw-r--r--lib/table.c2
-rw-r--r--lib/zclient.c4
-rw-r--r--ospf6d/ospf6_asbr.c2
-rw-r--r--pimd/pim_tlv.c2
-rw-r--r--pimd/pim_zlookup.c2
-rw-r--r--zebra/kernel_socket.c2
-rw-r--r--zebra/rtadv.c2
-rw-r--r--zebra/zapi_msg.c4
-rw-r--r--zebra/zebra_dplane.c4
-rw-r--r--zebra/zebra_mpls.c2
-rw-r--r--zebra/zebra_nhg.c2
-rw-r--r--zebra/zebra_pbr.c4
-rw-r--r--zebra/zebra_rib.c2
16 files changed, 22 insertions, 24 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index a51816116..1ddf1f4cf 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -102,8 +102,7 @@ static int bgp_md5_set_socket(int socket, union sockunion *su,
/* For addresses, use the non-extended signature functionality */
if ((su2.sa.sa_family == AF_INET && prefixlen == IPV4_MAX_PREFIXLEN)
- || (su2.sa.sa_family == AF_INET6
- && prefixlen == IPV6_MAX_PREFIXLEN))
+ || (su2.sa.sa_family == AF_INET6 && prefixlen == IPV6_MAX_BITLEN))
ret = sockopt_tcp_signature(socket, &su2, password);
else
ret = sockopt_tcp_signature_ext(socket, &su2, prefixlen,
@@ -164,8 +163,8 @@ static int bgp_md5_set_password(struct peer *peer, const char *password)
peer->su.sa.sa_family) {
uint16_t prefixlen =
peer->su.sa.sa_family == AF_INET
- ? IPV4_MAX_PREFIXLEN
- : IPV6_MAX_PREFIXLEN;
+ ? IPV4_MAX_PREFIXLEN
+ : IPV6_MAX_BITLEN;
/*
* if we have stored a BGP vrf instance in the
@@ -746,7 +745,7 @@ int bgp_connect(struct peer *peer)
if (peer->password) {
uint16_t prefixlen = peer->su.sa.sa_family == AF_INET
? IPV4_MAX_PREFIXLEN
- : IPV6_MAX_PREFIXLEN;
+ : IPV6_MAX_BITLEN;
bgp_md5_set_connect(peer->fd, &peer->su, prefixlen,
peer->password);
diff --git a/ldpd/labelmapping.c b/ldpd/labelmapping.c
index cee9d527e..53f3c00fb 100644
--- a/ldpd/labelmapping.c
+++ b/ldpd/labelmapping.c
@@ -726,7 +726,7 @@ tlv_decode_fec_elm(struct nbr *nbr, struct ldp_msg *msg, char *buf,
if ((map->fec.prefix.af == AF_IPV4
&& map->fec.prefix.prefixlen > IPV4_MAX_PREFIXLEN)
|| (map->fec.prefix.af == AF_IPV6
- && map->fec.prefix.prefixlen > IPV6_MAX_PREFIXLEN)) {
+ && map->fec.prefix.prefixlen > IPV6_MAX_BITLEN)) {
session_shutdown(nbr, S_BAD_TLV_VAL, msg->id,
msg->type);
return (-1);
diff --git a/lib/prefix.h b/lib/prefix.h
index c47e701df..890dcd7ef 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -398,7 +398,6 @@ static inline void ipv4_addr_copy(struct in_addr *dst,
/* Max bit/byte length of IPv6 address. */
#define IPV6_MAX_BYTELEN 16
#define IPV6_MAX_BITLEN 128
-#define IPV6_MAX_PREFIXLEN 128
#define IPV6_ADDR_CMP(D,S) memcmp ((D), (S), IPV6_MAX_BYTELEN)
#define IPV6_ADDR_SAME(D,S) (memcmp ((D), (S), IPV6_MAX_BYTELEN) == 0)
#define IPV6_ADDR_COPY(D,S) memcpy ((D), (S), IPV6_MAX_BYTELEN)
diff --git a/lib/table.c b/lib/table.c
index dfd92c618..171b3a897 100644
--- a/lib/table.c
+++ b/lib/table.c
@@ -243,7 +243,7 @@ struct route_node *route_node_match_ipv6(struct route_table *table,
memset(&p, 0, sizeof(struct prefix_ipv6));
p.family = AF_INET6;
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
p.prefix = *addr;
return route_node_match(table, &p);
diff --git a/lib/zclient.c b/lib/zclient.c
index ffae1332a..c0efeebeb 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -1441,7 +1441,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
}
break;
case AF_INET6:
- if (api->prefix.prefixlen > IPV6_MAX_PREFIXLEN) {
+ if (api->prefix.prefixlen > IPV6_MAX_BITLEN) {
flog_err(
EC_LIB_ZAPI_ENCODE,
"%s: v6 prefixlen is %d which should not be more than 128",
@@ -1460,7 +1460,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
if (CHECK_FLAG(api->message, ZAPI_MESSAGE_SRCPFX)) {
api->src_prefix.family = AF_INET6;
STREAM_GETC(s, api->src_prefix.prefixlen);
- if (api->src_prefix.prefixlen > IPV6_MAX_PREFIXLEN) {
+ if (api->src_prefix.prefixlen > IPV6_MAX_BITLEN) {
flog_err(
EC_LIB_ZAPI_ENCODE,
"%s: SRC Prefix prefixlen received: %d is too large",
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 315449ae9..b53fc717a 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -556,7 +556,7 @@ void ospf6_asbr_lsa_add(struct ospf6_lsa *lsa)
+ OSPF6_PREFIX_SPACE(external->prefix.prefix_length);
memset(&fwd_addr, 0, sizeof(struct prefix));
fwd_addr.family = AF_INET6;
- fwd_addr.prefixlen = IPV6_MAX_PREFIXLEN;
+ fwd_addr.prefixlen = IPV6_MAX_BITLEN;
memcpy(&fwd_addr.u.prefix6, (caddr_t)external + offset,
sizeof(struct in6_addr));
diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c
index f21c369b8..8d6d3a416 100644
--- a/pimd/pim_tlv.c
+++ b/pimd/pim_tlv.c
@@ -495,7 +495,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)
}
p->family = AF_INET6;
- p->prefixlen = IPV6_MAX_PREFIXLEN;
+ p->prefixlen = IPV6_MAX_BITLEN;
memcpy(&p->u.prefix6, addr, sizeof(struct in6_addr));
addr += sizeof(struct in6_addr);
diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c
index 9ccf1fedd..dce936b8a 100644
--- a/pimd/pim_zlookup.c
+++ b/pimd/pim_zlookup.c
@@ -276,7 +276,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,
nexthop_tab[num_ifindex].ifindex = stream_getl(s);
p.family = AF_INET6;
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
memcpy(&p.u.prefix6,
&nexthop_tab[num_ifindex].nexthop_addr.u.prefix6,
sizeof(struct in6_addr));
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 03884a916..d3e5f4233 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -1079,7 +1079,7 @@ void rtm_read(struct rt_msghdr *rtm)
p.family = AF_INET6;
p.u.prefix6 = dest.sin6.sin6_addr;
if (flags & RTF_HOST)
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
else
p.prefixlen = ip6_masklen(mask.sin6.sin6_addr);
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 8cb0223a4..976beefab 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -693,7 +693,7 @@ static void rtadv_process_advert(uint8_t *msg, unsigned int len,
/* Create entry for neighbor if not known. */
p.family = AF_INET6;
IPV6_ADDR_COPY(&p.u.prefix6, &addr->sin6_addr);
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
if (!nbr_connected_check(ifp, &p))
nbr_connected_add_ipv6(ifp, &addr->sin6_addr);
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index d5969ab9b..8f2aa2fb0 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -480,7 +480,7 @@ void nbr_connected_add_ipv6(struct interface *ifp, struct in6_addr *address)
p.family = AF_INET6;
IPV6_ADDR_COPY(&p.u.prefix6, address);
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
ifc = listnode_head(ifp->nbr_connected);
if (!ifc) {
@@ -505,7 +505,7 @@ void nbr_connected_delete_ipv6(struct interface *ifp, struct in6_addr *address)
p.family = AF_INET6;
IPV6_ADDR_COPY(&p.u.prefix6, address);
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
ifc = nbr_connected_check(ifp, &p);
if (!ifc)
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index a5d672987..90009cf17 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -2537,8 +2537,8 @@ static int dplane_ctx_pw_init(struct zebra_dplane_ctx *ctx,
*/
memcpy(&p.u, &pw->nexthop, sizeof(pw->nexthop));
p.family = pw->af;
- p.prefixlen = ((pw->af == AF_INET) ?
- IPV4_MAX_PREFIXLEN : IPV6_MAX_PREFIXLEN);
+ p.prefixlen =
+ ((pw->af == AF_INET) ? IPV4_MAX_PREFIXLEN : IPV6_MAX_BITLEN);
afi = (pw->af == AF_INET) ? AFI_IP : AFI_IP6;
table = zebra_vrf_table(afi, SAFI_UNICAST, pw->vrf_id);
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index a4576b310..638a06d66 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -662,7 +662,7 @@ static int nhlfe_nexthop_active_ipv6(zebra_nhlfe_t *nhlfe,
/* Lookup nexthop in IPv6 routing table. */
memset(&p, 0, sizeof(struct prefix_ipv6));
p.family = AF_INET6;
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
p.prefix = nexthop->gate.ipv6;
rn = route_node_match(table, (struct prefix *)&p);
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index face0ef3b..d48dc68df 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -2123,7 +2123,7 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
break;
case AFI_IP6:
p.family = AF_INET6;
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
p.u.prefix6 = nexthop->gate.ipv6;
break;
default:
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c
index 73c2c3dda..d26e15e27 100644
--- a/zebra/zebra_pbr.c
+++ b/zebra/zebra_pbr.c
@@ -925,8 +925,8 @@ static const char *zebra_pbr_prefix2str(union prefixconstptr pu,
const struct prefix *p = pu.p;
char buf[PREFIX2STR_BUFFER];
- if ((p->family == AF_INET && p->prefixlen == IPV4_MAX_PREFIXLEN) ||
- (p->family == AF_INET6 && p->prefixlen == IPV6_MAX_PREFIXLEN)) {
+ if ((p->family == AF_INET && p->prefixlen == IPV4_MAX_PREFIXLEN)
+ || (p->family == AF_INET6 && p->prefixlen == IPV6_MAX_BITLEN)) {
snprintf(str, size, "%s", inet_ntop(p->family, &p->u.prefix,
buf, PREFIX2STR_BUFFER));
return str;
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index d0acf7793..b25e31fd1 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -352,7 +352,7 @@ struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
p.prefixlen = IPV4_MAX_PREFIXLEN;
} else {
p.u.prefix6 = addr->ipv6;
- p.prefixlen = IPV6_MAX_PREFIXLEN;
+ p.prefixlen = IPV6_MAX_BITLEN;
}
rn = route_node_match(table, &p);