]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLEN
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Thu, 1 Jul 2021 14:42:03 +0000 (17:42 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Thu, 1 Jul 2021 14:44:09 +0000 (17:44 +0300)
Just drop IPV4_MAX_PREFIXLEN at all, no need keeping both.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
27 files changed:
bgpd/bgp_network.c
ldpd/labelmapping.c
lib/prefix.c
lib/prefix.h
lib/table.c
lib/zclient.c
ospfd/ospf_asbr.c
ospfd/ospf_interface.c
ospfd/ospf_te.c
ospfd/ospf_ti_lfa.c
ospfd/ospf_zebra.c
pimd/pim_iface.c
pimd/pim_ifchannel.c
pimd/pim_register.c
pimd/pim_rp.c
pimd/pim_tlv.c
pimd/pim_upstream.c
pimd/pim_util.c
ripd/rip_interface.c
ripd/ripd.c
zebra/connected.c
zebra/kernel_socket.c
zebra/zebra_dplane.c
zebra/zebra_mpls.c
zebra/zebra_nhg.c
zebra/zebra_pbr.c
zebra/zebra_rib.c

index 1ddf1f4cf729529267673986bfba91e184de5412..3c061ef1e0ece77a90256282224639d4a78cb0ff 100644 (file)
@@ -101,7 +101,7 @@ static int bgp_md5_set_socket(int socket, union sockunion *su,
                su2.sin6.sin6_port = 0;
 
        /* For addresses, use the non-extended signature functionality */
-       if ((su2.sa.sa_family == AF_INET && prefixlen == IPV4_MAX_PREFIXLEN)
+       if ((su2.sa.sa_family == AF_INET && prefixlen == IPV4_MAX_BITLEN)
            || (su2.sa.sa_family == AF_INET6 && prefixlen == IPV6_MAX_BITLEN))
                ret = sockopt_tcp_signature(socket, &su2, password);
        else
@@ -163,7 +163,7 @@ 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
+                                               ? IPV4_MAX_BITLEN
                                                : IPV6_MAX_BITLEN;
 
                                /*
@@ -744,7 +744,7 @@ int bgp_connect(struct peer *peer)
 
        if (peer->password) {
                uint16_t prefixlen = peer->su.sa.sa_family == AF_INET
-                                            ? IPV4_MAX_PREFIXLEN
+                                            ? IPV4_MAX_BITLEN
                                             : IPV6_MAX_BITLEN;
 
                bgp_md5_set_connect(peer->fd, &peer->su, prefixlen,
index 53f3c00fbb3d1d4e5aa939593f1098d0fe8ce821..13d3243124cfeaf0613a48275f14fc15d5a97273 100644 (file)
@@ -724,7 +724,7 @@ tlv_decode_fec_elm(struct nbr *nbr, struct ldp_msg *msg, char *buf,
                map->fec.prefix.prefixlen = buf[off];
                off += sizeof(uint8_t);
                if ((map->fec.prefix.af == AF_IPV4
-                    && map->fec.prefix.prefixlen > IPV4_MAX_PREFIXLEN)
+                    && map->fec.prefix.prefixlen > IPV4_MAX_BITLEN)
                    || (map->fec.prefix.af == AF_IPV6
                        && map->fec.prefix.prefixlen > IPV6_MAX_BITLEN)) {
                        session_shutdown(nbr, S_BAD_TLV_VAL, msg->id,
index 7dbb5f07f0fd53af930d3fb0eb3bbc3a33c6adee..1c57715e8f3a1ad4bc87f2247dbf5b001501513a 100644 (file)
@@ -577,7 +577,7 @@ int str2prefix_ipv4(const char *str, struct prefix_ipv4 *p)
 
                /* Get prefix length. */
                plen = (uint8_t)atoi(++pnt);
-               if (plen > IPV4_MAX_PREFIXLEN)
+               if (plen > IPV4_MAX_BITLEN)
                        return 0;
 
                p->family = AF_INET;
@@ -1128,7 +1128,7 @@ void apply_classful_mask_ipv4(struct prefix_ipv4 *p)
 
        destination = ntohl(p->prefix.s_addr);
 
-       if (p->prefixlen == IPV4_MAX_PREFIXLEN)
+       if (p->prefixlen == IPV4_MAX_BITLEN)
                ;
        /* do nothing for host routes */
        else if (IN_CLASSC(destination)) {
@@ -1148,12 +1148,13 @@ in_addr_t ipv4_broadcast_addr(in_addr_t hostaddr, int masklen)
        struct in_addr mask;
 
        masklen2ip(masklen, &mask);
-       return (masklen != IPV4_MAX_PREFIXLEN - 1) ?
-               /* normal case */
-               (hostaddr | ~mask.s_addr)
-                  :
-               /* For prefix 31 return 255.255.255.255 (RFC3021) */
-               htonl(0xFFFFFFFF);
+       return (masklen != IPV4_MAX_BITLEN - 1)
+                      ?
+                      /* normal case */
+                      (hostaddr | ~mask.s_addr)
+                      :
+                      /* For prefix 31 return 255.255.255.255 (RFC3021) */
+                      htonl(0xFFFFFFFF);
 }
 
 /* Utility function to convert ipv4 netmask to prefixes
index 890dcd7efa30a344989713a1dacbbb0fa7fe05fe..bc4cb7f441c2007c746d86c3d90ecb9ab30c12bd 100644 (file)
@@ -372,7 +372,6 @@ union prefixconstptr {
 /* Max bit/byte length of IPv4 address. */
 #define IPV4_MAX_BYTELEN    4
 #define IPV4_MAX_BITLEN    32
-#define IPV4_MAX_PREFIXLEN 32
 #define IPV4_ADDR_CMP(D,S)   memcmp ((D), (S), IPV4_MAX_BYTELEN)
 
 static inline bool ipv4_addr_same(const struct in_addr *a,
index 171b3a89708502870544c7f521ae60770be48310..e6030ca4cab732ff3e4c0074b99629607883d5f1 100644 (file)
@@ -230,7 +230,7 @@ struct route_node *route_node_match_ipv4(struct route_table *table,
 
        memset(&p, 0, sizeof(struct prefix_ipv4));
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = *addr;
 
        return route_node_match(table, (struct prefix *)&p);
index c0efeebeb325d5f196d89516ee7363665f9162ca..7979f13f22c439219e8738c91c1e1cc28cd1ce83 100644 (file)
@@ -1432,7 +1432,7 @@ int zapi_route_decode(struct stream *s, struct zapi_route *api)
        STREAM_GETC(s, api->prefix.prefixlen);
        switch (api->prefix.family) {
        case AF_INET:
-               if (api->prefix.prefixlen > IPV4_MAX_PREFIXLEN) {
+               if (api->prefix.prefixlen > IPV4_MAX_BITLEN) {
                        flog_err(
                                EC_LIB_ZAPI_ENCODE,
                                "%s: V4 prefixlen is %d which should not be more than 32",
index 2fd195bb6d10461092720cc53f9a74b8dd894c04..192dbe4fc8c0d8bffef6280fc148359a1088c946 100644 (file)
@@ -361,7 +361,7 @@ bool is_valid_summary_addr(struct prefix_ipv4 *p)
                return false;
 
        /*Host route shouldn't be configured as summary addres*/
-       if (p->prefixlen == IPV4_MAX_PREFIXLEN)
+       if (p->prefixlen == IPV4_MAX_BITLEN)
                return false;
 
        return true;
index b3aba247dfb4f0b399aa9dabc53782ad6506ed36..029f929c110d784cdaab4731c58ff91b47600a44 100644 (file)
@@ -188,7 +188,7 @@ struct ospf_interface *ospf_if_table_lookup(struct interface *ifp,
        struct ospf_interface *rninfo = NULL;
 
        p = *prefix;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
 
        /* route_node_get implicitely locks */
        if ((rn = route_node_lookup(IF_OIFS(ifp), &p))) {
@@ -205,7 +205,7 @@ static void ospf_add_to_if(struct interface *ifp, struct ospf_interface *oi)
        struct prefix p;
 
        p = *oi->address;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        apply_mask(&p);
 
        rn = route_node_get(IF_OIFS(ifp), &p);
@@ -223,7 +223,7 @@ static void ospf_delete_from_if(struct interface *ifp,
        struct prefix p;
 
        p = *oi->address;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
 
        rn = route_node_lookup(IF_OIFS(oi->ifp), &p);
        assert(rn);
@@ -566,7 +566,7 @@ void ospf_free_if_params(struct interface *ifp, struct in_addr addr)
        struct route_node *rn;
 
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = addr;
        rn = route_node_lookup(IF_OIFS_PARAMS(ifp), (struct prefix *)&p);
        if (!rn || !rn->info)
@@ -601,7 +601,7 @@ struct ospf_if_params *ospf_lookup_if_params(struct interface *ifp,
        struct route_node *rn;
 
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = addr;
 
        rn = route_node_lookup(IF_OIFS_PARAMS(ifp), (struct prefix *)&p);
@@ -621,7 +621,7 @@ struct ospf_if_params *ospf_get_if_params(struct interface *ifp,
        struct route_node *rn;
 
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = addr;
        apply_mask_ipv4(&p);
 
index 333fa6a3a18d75bb041b7d4ada5a70b7b826b0ff..d95e677f6f2bdb20d5d18930a0431dec3c95f128 100644 (file)
@@ -1840,7 +1840,7 @@ static void ospf_te_update_subnet(struct ls_ted *ted, struct ls_vertex *vertex,
 
 /**
  * Delete Subnet that correspond to the given IPv4 address and export deletion
- * information before removal. Prefix length is fixed to IPV4_MAX_PREFIXLEN.
+ * information before removal. Prefix length is fixed to IPV4_MAX_BITLEN.
  *
  * @param ted  Links State Database
  * @param addr IPv4 address
@@ -1852,7 +1852,7 @@ static void ospf_te_delete_subnet(struct ls_ted *ted, struct in_addr addr)
 
        /* Search subnet that correspond to the address/32 as prefix */
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.u.prefix4 = addr;
        subnet = ls_find_subnet(ted, p);
 
@@ -1944,7 +1944,7 @@ static int ospf_te_parse_router_lsa(struct ls_ted *ted, struct ospf_lsa *lsa)
                                            ntohs(rl->link[i].metric));
                        /* Add corresponding subnet */
                        p.family = AF_INET;
-                       p.prefixlen = IPV4_MAX_PREFIXLEN;
+                       p.prefixlen = IPV4_MAX_BITLEN;
                        p.u.prefix4 = rl->link[i].link_data;
                        metric = ntohs(rl->link[i].metric);
                        ospf_te_update_subnet(ted, vertex, p, metric);
@@ -1952,7 +1952,7 @@ static int ospf_te_parse_router_lsa(struct ls_ted *ted, struct ospf_lsa *lsa)
                case LSA_LINK_TYPE_STUB:
                        /* Keep only /32 prefix */
                        p.prefixlen = ip_masklen(rl->link[i].link_data);
-                       if (p.prefixlen == IPV4_MAX_PREFIXLEN) {
+                       if (p.prefixlen == IPV4_MAX_BITLEN) {
                                p.family = AF_INET;
                                p.u.prefix4 = rl->link[i].link_id;
                                metric = ntohs(rl->link[i].metric);
@@ -2086,12 +2086,12 @@ static void ospf_te_update_remote_asbr(struct ls_ted *ted, struct ls_edge *edge)
 
        /* Update corresponding Subnets */
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.u.prefix4 = attr->standard.local;
        ospf_te_update_subnet(ted, edge->source, p, attr->standard.te_metric);
 
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.u.prefix4 = attr->standard.remote_addr;
        ospf_te_update_subnet(ted, vertex, p, attr->standard.te_metric);
 
index 59b3b624e3903f016130172c440aec9b2c394a62..347128a4f428b0275161e89d3d1fdbaf81df0ddf 100644 (file)
@@ -849,7 +849,7 @@ void ospf_ti_lfa_generate_p_spaces(struct ospf_area *area,
 
        stub_prefix.family = AF_INET;
        child_prefix.family = AF_INET;
-       child_prefix.prefixlen = IPV4_MAX_PREFIXLEN;
+       child_prefix.prefixlen = IPV4_MAX_BITLEN;
 
        p = ((uint8_t *)root->lsa) + OSPF_LSA_HEADER_SIZE + 4;
        lim = ((uint8_t *)root->lsa) + ntohs(root->lsa->length);
index df112edc6804dda1587b15359d11268b2afefc87..017915e0ee3bbb57556388303d147fa94cb96e31 100644 (file)
@@ -138,7 +138,7 @@ static int ospf_interface_address_delete(ZAPI_CALLBACK_ARGS)
 
        ifp = c->ifp;
        p = *c->address;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
 
        rn = route_node_lookup(IF_OIFS(ifp), &p);
        if (!rn) {
index 353f1330015f570244db5c4613cd8c158ab9da61..48b019c8c8877a85c13f61292a01e338f10ce7af 100644 (file)
@@ -1139,7 +1139,7 @@ struct pim_neighbor *pim_if_find_neighbor(struct interface *ifp,
 
        p.family = AF_INET;
        p.u.prefix4 = addr;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
 
        for (ALL_LIST_ELEMENTS_RO(pim_ifp->pim_neighbor_list, neighnode,
                                  neigh)) {
index 1bf3a619bf69c710c53e33a1aecb8facafe624df..9ee06edfc191cb80d7024e0a6c4276014a4ca10b 100644 (file)
@@ -1248,7 +1248,7 @@ int pim_ifchannel_local_membership_add(struct interface *ifp,
                                        AFI_IP, pim->spt.plist);
                                struct prefix g;
                                g.family = AF_INET;
-                               g.prefixlen = IPV4_MAX_PREFIXLEN;
+                               g.prefixlen = IPV4_MAX_BITLEN;
                                g.u.prefix4 = up->sg.grp;
 
                                if (prefix_list_apply(plist, &g)
index 90b69a54f2cd18da27b7bed221a3e8ec3e658a8a..7313a2fba21cc2d7ae369fe7ebab12ccef2c04b5 100644 (file)
@@ -393,7 +393,7 @@ int pim_register_recv(struct interface *ifp, struct in_addr dest_addr,
                        plist = prefix_list_lookup(AFI_IP, pim->register_plist);
 
                        src.family = AF_INET;
-                       src.prefixlen = IPV4_MAX_PREFIXLEN;
+                       src.prefixlen = IPV4_MAX_BITLEN;
                        src.u.prefix4 = sg.src;
 
                        if (prefix_list_apply(plist, &src) == PREFIX_DENY) {
index a31fec036fc6a1ef7d36ca586c3193773cfc4b10..fc56a8817a13c5172d68d48e06c3ae05df3f962d 100644 (file)
@@ -124,7 +124,7 @@ void pim_rp_init(struct pim_instance *pim)
        }
        rp_info->group.family = AF_INET;
        rp_info->rp.rpf_addr.family = AF_INET;
-       rp_info->rp.rpf_addr.prefixlen = IPV4_MAX_PREFIXLEN;
+       rp_info->rp.rpf_addr.prefixlen = IPV4_MAX_BITLEN;
        rp_info->rp.rpf_addr.u.prefix4.s_addr = INADDR_NONE;
 
        listnode_add(pim->rp_list, rp_info);
@@ -417,7 +417,7 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr,
        rp_info = XCALLOC(MTYPE_PIM_RP, sizeof(*rp_info));
 
        rp_info->rp.rpf_addr.family = AF_INET;
-       rp_info->rp.rpf_addr.prefixlen = IPV4_MAX_PREFIXLEN;
+       rp_info->rp.rpf_addr.prefixlen = IPV4_MAX_BITLEN;
        rp_info->rp.rpf_addr.u.prefix4 = rp_addr;
        prefix_copy(&rp_info->group, &group);
        rp_info->rp_src = rp_src_flag;
index 8d6d3a416b6763e2f596c3a59e768dda7105e4df..62cecac41e6a6da668424f06e9f9981d489903d6 100644 (file)
@@ -481,7 +481,7 @@ int pim_parse_addr_ucast(struct prefix *p, const uint8_t *buf, int buf_size)
                p->family = AF_INET; /* notice: AF_INET !=
                                        PIM_MSG_ADDRESS_FAMILY_IPV4 */
                memcpy(&p->u.prefix4, addr, sizeof(struct in_addr));
-               p->prefixlen = IPV4_MAX_PREFIXLEN;
+               p->prefixlen = IPV4_MAX_BITLEN;
                addr += sizeof(struct in_addr);
 
                break;
index 918a9a9c7d7630e6f8840b22da3c279cbcf03000..2b674b4234d7548d8181c9d6d1adf1a2d0145ff5 100644 (file)
@@ -2174,7 +2174,7 @@ void pim_upstream_remove_lhr_star_pimreg(struct pim_instance *pim,
        np = prefix_list_lookup(AFI_IP, nlist);
 
        g.family = AF_INET;
-       g.prefixlen = IPV4_MAX_PREFIXLEN;
+       g.prefixlen = IPV4_MAX_BITLEN;
 
        frr_each (rb_pim_upstream, &pim->upstream_head, up) {
                if (up->sg.src.s_addr != INADDR_ANY)
index 15bde256daf77ee3888507ad6442c7aa44e6c46d..11a0abd193f0591a245fe59563bd89a88c4627e3 100644 (file)
@@ -115,7 +115,7 @@ int pim_is_group_224_0_0_0_24(struct in_addr group_addr)
 
        group.family = AF_INET;
        group.u.prefix4 = group_addr;
-       group.prefixlen = IPV4_MAX_PREFIXLEN;
+       group.prefixlen = IPV4_MAX_BITLEN;
 
        return prefix_match(&group_224, &group);
 }
index bdae2c5ef5fa9d717338817c26eab3a6a52be598..7a8e10f30b35c1a817ac245dd88f6ca53b3b6a19 100644 (file)
@@ -160,7 +160,7 @@ static void rip_request_interface_send(struct interface *ifp, uint8_t version)
                                 * destination addr */
                                to.sin_addr = connected->destination->u.prefix4;
                        else if (connected->address->prefixlen
-                                < IPV4_MAX_PREFIXLEN)
+                                < IPV4_MAX_BITLEN)
                                /* calculate the appropriate broadcast
                                 * address */
                                to.sin_addr.s_addr = ipv4_broadcast_addr(
index 7d940efd9c615ea19c355f44b1966913c0885231..fe4a349b1a33d7bc058b6ef64514eb63192fce3d 100644 (file)
@@ -2429,7 +2429,7 @@ static void rip_update_interface(struct connected *ifc, uint8_t version,
                                /* use specified broadcast or peer destination
                                 * addr */
                                to.sin_addr = ifc->destination->u.prefix4;
-                       else if (ifc->address->prefixlen < IPV4_MAX_PREFIXLEN)
+                       else if (ifc->address->prefixlen < IPV4_MAX_BITLEN)
                                /* calculate the appropriate broadcast address
                                 */
                                to.sin_addr.s_addr = ipv4_broadcast_addr(
index dc7193eb4c9da62bd88ec8892fd88a9de297528d..1c3dfe2a2f9b0530a33105eda775e86d6a8417d6 100644 (file)
@@ -330,8 +330,8 @@ void connected_add_ipv4(struct interface *ifp, int flags, struct in_addr *addr,
        p = prefix_ipv4_new();
        p->family = AF_INET;
        p->prefix = *addr;
-       p->prefixlen = CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_PREFIXLEN
-                                                        : prefixlen;
+       p->prefixlen =
+               CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_BITLEN : prefixlen;
        ifc->address = (struct prefix *)p;
 
        /* If there is a peer address. */
@@ -358,8 +358,7 @@ void connected_add_ipv4(struct interface *ifp, int flags, struct in_addr *addr,
        }
 
        /* no destination address was supplied */
-       if (!dest && (prefixlen == IPV4_MAX_PREFIXLEN)
-               && if_is_pointopoint(ifp))
+       if (!dest && (prefixlen == IPV4_MAX_BITLEN) && if_is_pointopoint(ifp))
                zlog_debug(
                        "PtP interface %s with addr %pI4/%d needs a peer address",
                        ifp->name, addr, prefixlen);
@@ -512,8 +511,8 @@ void connected_delete_ipv4(struct interface *ifp, int flags,
        memset(&p, 0, sizeof(struct prefix));
        p.family = AF_INET;
        p.u.prefix4 = *addr;
-       p.prefixlen = CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_PREFIXLEN
-                                                       : prefixlen;
+       p.prefixlen =
+               CHECK_FLAG(flags, ZEBRA_IFA_PEER) ? IPV4_MAX_BITLEN : prefixlen;
 
        if (dest) {
                memset(&d, 0, sizeof(struct prefix));
index d3e5f42338445c54152c7019f1488c504fc8dad9..252bf04782b294796b3db6b13ffc24dfc8e88aa6 100644 (file)
@@ -1066,7 +1066,7 @@ void rtm_read(struct rt_msghdr *rtm)
                p.family = AF_INET;
                p.u.prefix4 = dest.sin.sin_addr;
                if (flags & RTF_HOST)
-                       p.prefixlen = IPV4_MAX_PREFIXLEN;
+                       p.prefixlen = IPV4_MAX_BITLEN;
                else
                        p.prefixlen = ip_masklen(mask.sin.sin_addr);
 
index 90009cf17e720c739e3437f06ee28d8d1713a5d7..04411fa0d208b1c77781cda0d8eda5a6734e6e36 100644 (file)
@@ -2537,8 +2537,7 @@ 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_BITLEN);
+       p.prefixlen = ((pw->af == AF_INET) ? IPV4_MAX_BITLEN : IPV6_MAX_BITLEN);
 
        afi = (pw->af == AF_INET) ? AFI_IP : AFI_IP6;
        table = zebra_vrf_table(afi, SAFI_UNICAST, pw->vrf_id);
index 638a06d664c007573048e7ad9db04da18a7017fe..a2d1513ce4874530b71676f10bec90bcd5c001d6 100644 (file)
@@ -613,7 +613,7 @@ static int nhlfe_nexthop_active_ipv4(zebra_nhlfe_t *nhlfe,
        /* Lookup nexthop in IPv4 routing table. */
        memset(&p, 0, sizeof(struct prefix_ipv4));
        p.family = AF_INET;
-       p.prefixlen = IPV4_MAX_PREFIXLEN;
+       p.prefixlen = IPV4_MAX_BITLEN;
        p.prefix = nexthop->gate.ipv4;
 
        rn = route_node_match(table, (struct prefix *)&p);
index d48dc68df6b3e0044febf4f5c43b0fc77301ba64..7495a3a69a665b4e25e4bd9f0343f73f255b3a95 100644 (file)
@@ -2118,7 +2118,7 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
        switch (afi) {
        case AFI_IP:
                p.family = AF_INET;
-               p.prefixlen = IPV4_MAX_PREFIXLEN;
+               p.prefixlen = IPV4_MAX_BITLEN;
                p.u.prefix4 = *ipv4;
                break;
        case AFI_IP6:
index d26e15e27a7df0517890ad27b8d4edb92f60daef..7bcd097371778c416bddb11c943d260761ce5f6a 100644 (file)
@@ -925,7 +925,7 @@ 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)
+       if ((p->family == AF_INET && p->prefixlen == IPV4_MAX_BITLEN)
            || (p->family == AF_INET6 && p->prefixlen == IPV6_MAX_BITLEN)) {
                snprintf(str, size, "%s", inet_ntop(p->family, &p->u.prefix,
                                                    buf, PREFIX2STR_BUFFER));
index b25e31fd1fe2464d5652c38ba1cba4e087b92ac4..12cc0b4e8a85663d57c67dc9df2010a978098acd 100644 (file)
@@ -349,7 +349,7 @@ struct route_entry *rib_match(afi_t afi, safi_t safi, vrf_id_t vrf_id,
        p.family = afi;
        if (afi == AFI_IP) {
                p.u.prefix4 = addr->ipv4;
-               p.prefixlen = IPV4_MAX_PREFIXLEN;
+               p.prefixlen = IPV4_MAX_BITLEN;
        } else {
                p.u.prefix6 = addr->ipv6;
                p.prefixlen = IPV6_MAX_BITLEN;