]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_mplsvpn.c
isisd: retrofit the 'isis [c|p]snp-interval' commands
[mirror_frr.git] / bgpd / bgp_mplsvpn.c
index d4204126e170476fa90d9ad1f6a2c4f932815e70..cf91faf964a9b93eda47effb2b57374a8913ae3d 100644 (file)
@@ -500,7 +500,7 @@ leak_update(struct bgp *bgp, /* destination bgp instance */
        /*
         * match parent
         */
-       for (bpi = bn->info; bpi; bpi = bpi->next) {
+       for (bpi = bgp_node_get_bgp_path_info(bn); bpi; bpi = bpi->next) {
                if (bpi->extra && bpi->extra->parent == parent)
                        break;
        }
@@ -919,11 +919,13 @@ void vpn_leak_from_vrf_withdraw(struct bgp *bgp_vpn,              /* to */
        bn = bgp_afi_node_get(bgp_vpn->rib[afi][safi], afi, safi, p,
                              &(bgp_vrf->vpn_policy[afi].tovpn_rd));
 
+       if (!bn)
+               return;
        /*
         * vrf -> vpn
         * match original bpi imported from
         */
-       for (bpi = (bn ? bn->info : NULL); bpi; bpi = bpi->next) {
+       for (bpi = bgp_node_get_bgp_path_info(bn); bpi; bpi = bpi->next) {
                if (bpi->extra && bpi->extra->parent == path_vrf) {
                        break;
                }
@@ -959,7 +961,7 @@ void vpn_leak_from_vrf_withdraw_all(struct bgp *bgp_vpn, /* to */
                struct bgp_path_info *bpi;
 
                /* This is the per-RD table of prefixes */
-               table = prn->info;
+               table = bgp_node_get_bgp_table_info(prn);
 
                if (!table)
                        continue;
@@ -968,13 +970,14 @@ void vpn_leak_from_vrf_withdraw_all(struct bgp *bgp_vpn, /* to */
 
                        char buf[PREFIX2STR_BUFFER];
 
-                       if (debug && bn->info) {
+                       bpi = bgp_node_get_bgp_path_info(bn);
+                       if (debug && bpi) {
                                zlog_debug(
                                        "%s: looking at prefix %s", __func__,
                                        prefix2str(&bn->p, buf, sizeof(buf)));
                        }
 
-                       for (bpi = bn->info; bpi; bpi = bpi->next) {
+                       for (; bpi; bpi = bpi->next) {
                                if (debug)
                                        zlog_debug("%s: type %d, sub_type %d",
                                                   __func__, bpi->type,
@@ -1017,7 +1020,8 @@ void vpn_leak_from_vrf_update_all(struct bgp *bgp_vpn, /* to */
                if (debug)
                        zlog_debug("%s: node=%p", __func__, bn);
 
-               for (bpi = bn->info; bpi; bpi = bpi->next) {
+               for (bpi = bgp_node_get_bgp_path_info(bn); bpi;
+                    bpi = bpi->next) {
                        if (debug)
                                zlog_debug(
                                        "%s: calling vpn_leak_from_vrf_update",
@@ -1299,7 +1303,9 @@ void vpn_leak_to_vrf_withdraw(struct bgp *bgp_vpn,            /* from */
                                   bgp->name_pretty);
 
                bn = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, NULL);
-               for (bpi = (bn ? bn->info : NULL); bpi; bpi = bpi->next) {
+
+               for (bpi = bgp_node_get_bgp_path_info(bn); bpi;
+                    bpi = bpi->next) {
                        if (bpi->extra
                            && (struct bgp_path_info *)bpi->extra->parent
                                       == path_vpn) {
@@ -1335,7 +1341,8 @@ void vpn_leak_to_vrf_withdraw_all(struct bgp *bgp_vrf, /* to */
        for (bn = bgp_table_top(bgp_vrf->rib[afi][safi]); bn;
             bn = bgp_route_next(bn)) {
 
-               for (bpi = bn->info; bpi; bpi = bpi->next) {
+               for (bpi = bgp_node_get_bgp_path_info(bn); bpi;
+                    bpi = bpi->next) {
                        if (bpi->extra && bpi->extra->bgp_orig != bgp_vrf) {
 
                                /* delete route */
@@ -1374,14 +1381,15 @@ void vpn_leak_to_vrf_update_all(struct bgp *bgp_vrf, /* to */
                memcpy(prd.val, prn->p.u.val, 8);
 
                /* This is the per-RD table of prefixes */
-               table = prn->info;
+               table = bgp_node_get_bgp_table_info(prn);
 
                if (!table)
                        continue;
 
                for (bn = bgp_table_top(table); bn; bn = bgp_route_next(bn)) {
 
-                       for (bpi = bn->info; bpi; bpi = bpi->next) {
+                       for (bpi = bgp_node_get_bgp_path_info(bn); bpi;
+                            bpi = bpi->next) {
 
                                if (bpi->extra
                                    && bpi->extra->bgp_orig == bgp_vrf)