]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlen
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Thu, 1 Jul 2021 14:37:04 +0000 (17:37 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Thu, 1 Jul 2021 14:37:04 +0000 (17:37 +0300)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_vty.c
bgpd/rfapi/vnc_export_bgp.c

index 43f24cd3ccd615cc87f974b0415572c385d2ba82..07aed045cab1a807b84934a8d497efd2ede6a648 100644 (file)
@@ -405,7 +405,7 @@ int rfapiGetVncTunnelUnAddr(struct attr *attr, struct prefix *p)
                                case 8:
                                        if (p) {
                                                p->family = AF_INET;
-                                               p->prefixlen = 32;
+                                               p->prefixlen = IPV4_MAX_BITLEN;
                                                memcpy(p->u.val, pEncap->value,
                                                       4);
                                        }
@@ -445,7 +445,7 @@ int rfapiGetUnAddrOfVpnBi(struct bgp_path_info *bpi, struct prefix *p)
                        if (p) {
                                p->family = bpi->extra->vnc.import.un_family;
                                p->u.prefix4 = bpi->extra->vnc.import.un.addr4;
-                               p->prefixlen = 32;
+                               p->prefixlen = IPV4_MAX_BITLEN;
                        }
                        return 0;
                case AF_INET6:
@@ -2519,7 +2519,7 @@ void rfapiNexthop2Prefix(struct attr *attr, struct prefix *p)
        switch (p->family = BGP_MP_NEXTHOP_FAMILY(attr->mp_nexthop_len)) {
        case AF_INET:
                p->u.prefix4 = attr->mp_nexthop_global_in;
-               p->prefixlen = 32;
+               p->prefixlen = IPV4_MAX_BITLEN;
                break;
 
        case AF_INET6:
@@ -2537,7 +2537,7 @@ void rfapiUnicastNexthop2Prefix(afi_t afi, struct attr *attr, struct prefix *p)
 {
        if (afi == AFI_IP) {
                p->family = AF_INET;
-               p->prefixlen = 32;
+               p->prefixlen = IPV4_MAX_BITLEN;
                p->u.prefix4 = attr->nexthop;
        } else {
                rfapiNexthop2Prefix(attr, p);
@@ -2871,7 +2871,7 @@ static int rfapiGetNexthop(struct attr *attr, struct prefix *prefix)
        switch (BGP_MP_NEXTHOP_FAMILY(attr->mp_nexthop_len)) {
        case AF_INET:
                prefix->family = AF_INET;
-               prefix->prefixlen = 32;
+               prefix->prefixlen = IPV4_MAX_BITLEN;
                prefix->u.prefix4 = attr->mp_nexthop_global_in;
                break;
        case AF_INET6:
index e19952d1b076ee0feab9164cd4744d1c0587ce41..0c40aeb54e8f7c3c8268f178548f35bc673f290b 100644 (file)
@@ -260,7 +260,7 @@ int rfapiRaddr2Qprefix(struct rfapi_ip_addr *hia, struct prefix *pfx)
 
        switch (hia->addr_family) {
        case AF_INET:
-               pfx->prefixlen = 32;
+               pfx->prefixlen = IPV4_MAX_BITLEN;
                pfx->u.prefix4 = hia->addr.v4;
                break;
        case AF_INET6:
index c90fcf8d72fc8a5e1898c5b06bcace23417b088e..f8b8c7d6807eccb327f3879c1347c3af1136032b 100644 (file)
@@ -164,7 +164,7 @@ static int getce(struct bgp *bgp, struct attr *attr, struct prefix *pfx_ce)
                memset((uint8_t *)pfx_ce, 0, sizeof(*pfx_ce));
                memcpy(&pfx_ce->u.prefix4, ecp + 2, 4);
                pfx_ce->family = AF_INET;
-               pfx_ce->prefixlen = 32;
+               pfx_ce->prefixlen = IPV4_MAX_BITLEN;
 
                return 0;
        }