]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/rfapi/vnc_import_bgp.c
Merge pull request #10558 from Jafaral/ospf-net-or-iface
[mirror_frr.git] / bgpd / rfapi / vnc_import_bgp.c
index b23c1eda76c6f6adc233ba28bd9366e159d9c2c7..994de7d7298c99d8e5ae4eb7d035eeb799e36962 100644 (file)
@@ -108,9 +108,9 @@ static int is_host_prefix(const struct prefix *p)
 {
        switch (p->family) {
        case AF_INET:
-               return (p->prefixlen == 32);
+               return (p->prefixlen == IPV4_MAX_BITLEN);
        case AF_INET6:
-               return (p->prefixlen == 128);
+               return (p->prefixlen == IPV6_MAX_BITLEN);
        }
        return 0;
 }
@@ -373,8 +373,8 @@ static int process_unicast_route(struct bgp *bgp,            /* in */
         */
        rfapiUnicastNexthop2Prefix(afi, &hattr, unicast_nexthop);
 
-       if (hattr.ecommunity)
-               *ecom = ecommunity_dup(hattr.ecommunity);
+       if (bgp_attr_get_ecommunity(&hattr))
+               *ecom = ecommunity_dup(bgp_attr_get_ecommunity(&hattr));
        else
                *ecom = ecommunity_new();
 
@@ -480,8 +480,8 @@ static void vnc_import_bgp_add_route_mode_resolve_nve_one_bi(
 
        struct ecommunity *new_ecom = ecommunity_dup(ecom);
 
-       if (bpi->attr->ecommunity)
-               ecommunity_merge(new_ecom, bpi->attr->ecommunity);
+       if (bgp_attr_get_ecommunity(bpi->attr))
+               ecommunity_merge(new_ecom, bgp_attr_get_ecommunity(bpi->attr));
 
        if (bpi->extra)
                label = decode_label(&bpi->extra->label[0]);
@@ -818,8 +818,8 @@ static void vnc_import_bgp_add_route_mode_plain(struct bgp *bgp,
                memset(&prd, 0, sizeof(prd));
                rfapi_set_autord_from_vn(&prd, &vnaddr);
 
-               if (iattr && iattr->ecommunity)
-                       ecom = ecommunity_dup(iattr->ecommunity);
+               if (iattr && bgp_attr_get_ecommunity(iattr))
+                       ecom = ecommunity_dup(bgp_attr_get_ecommunity(iattr));
        }
 
        local_pref = calc_local_pref(iattr, peer);
@@ -1015,8 +1015,9 @@ static void vnc_import_bgp_add_route_mode_nvegroup(
                else
                        ecom = ecommunity_new();
 
-               if (iattr && iattr->ecommunity)
-                       ecom = ecommunity_merge(ecom, iattr->ecommunity);
+               if (iattr && bgp_attr_get_ecommunity(iattr))
+                       ecom = ecommunity_merge(ecom,
+                                               bgp_attr_get_ecommunity(iattr));
        }
 
        local_pref = calc_local_pref(iattr, peer);
@@ -1073,7 +1074,7 @@ static void vnc_import_bgp_del_route_mode_plain(struct bgp *bgp,
        vnaddr.addr_family = vn_pfx->family;
        switch (vn_pfx->family) {
        case AF_INET:
-               if (vn_pfx->prefixlen != 32) {
+               if (vn_pfx->prefixlen != IPV4_MAX_BITLEN) {
                        vnc_zlog_debug_verbose(
                                "%s: redist VN plen (%d) != 32, skipping",
                                __func__, vn_pfx->prefixlen);
@@ -1083,7 +1084,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);
@@ -1147,7 +1148,7 @@ static void vnc_import_bgp_del_route_mode_nvegroup(struct bgp *bgp,
        vnaddr.addr_family = vn_pfx->family;
        switch (vn_pfx->family) {
        case AF_INET:
-               if (vn_pfx->prefixlen != 32) {
+               if (vn_pfx->prefixlen != IPV4_MAX_BITLEN) {
                        vnc_zlog_debug_verbose(
                                "%s: redist VN plen (%d) != 32, skipping",
                                __func__, vn_pfx->prefixlen);
@@ -1157,7 +1158,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);