diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-01-11 16:14:11 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-13 14:13:52 +0100 |
commit | 2bb8b49ce13aee725fbce975eac1493890f8caff (patch) | |
tree | bd594621e7bd3e909684f6bd7f20f5d6ae1b4131 /zebra | |
parent | Merge pull request #12629 from opensourcerouting/fix/use_static_repo (diff) | |
download | frr-2bb8b49ce13aee725fbce975eac1493890f8caff.tar.xz frr-2bb8b49ce13aee725fbce975eac1493890f8caff.zip |
Revert "Merge pull request #11127 from louis-6wind/bgp-leak"
This reverts commit 16aa1809e7c8caad37e8edd4e5aaac4f344bc7d3, reversing
changes made to f616e716089b16d9a678846282a6ac5c55e31a56.
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/connected.c | 72 |
1 files changed, 6 insertions, 66 deletions
diff --git a/zebra/connected.c b/zebra/connected.c index 57c7f1925..c01be58e8 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -387,14 +387,10 @@ void connected_down(struct interface *ifp, struct connected *ifc) .ifindex = ifp->ifindex, .vrf_id = ifp->vrf->vrf_id, }; - struct zebra_vrf *zvrf, *zvrf_iter; - uint32_t count_ipv4 = 0; + struct zebra_vrf *zvrf; + uint32_t count = 0; struct listnode *cnode; struct connected *c; - struct route_table *table; - struct route_node *rn; - struct route_entry *re, *next; - struct vrf *vrf; zvrf = ifp->vrf->info; if (!zvrf) { @@ -460,14 +456,12 @@ void connected_down(struct interface *ifp, struct connected *ifc) prefix_copy(&cp, CONNECTED_PREFIX(c)); apply_mask(&cp); - if (CHECK_FLAG(c->conf, ZEBRA_IFC_DOWN)) - continue; + if (prefix_same(&p, &cp) && + !CHECK_FLAG(c->conf, ZEBRA_IFC_DOWN)) + count++; - if (prefix_same(&p, &cp)) + if (count >= 1) return; - - if (cp.family == AF_INET) - count_ipv4++; } /* @@ -480,60 +474,6 @@ void connected_down(struct interface *ifp, struct connected *ifc) rib_delete(afi, SAFI_MULTICAST, zvrf->vrf->vrf_id, ZEBRA_ROUTE_CONNECT, 0, 0, &p, NULL, &nh, 0, zvrf->table_id, 0, 0, false); - /* When the last IPv4 address of an interface is deleted, Linux removes - * all routes using this interface without any Netlink advertisement. - * The removed routes include those that only have this particular - * interface as a nexthop. Among those, remove the kernel one from the - * FRR RIB and reinstall the other that have been added from FRR. - */ - if (afi == AFI_IP && count_ipv4 == 0 && if_is_operative(ifp)) { - RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) { - zvrf_iter = vrf->info; - - if (!zvrf_iter) - continue; - - table = zvrf_iter->table[AFI_IP][SAFI_UNICAST]; - if (!table) - continue; - - for (rn = route_top(table); rn; - rn = srcdest_route_next(rn)) { - RNODE_FOREACH_RE_SAFE (rn, re, next) { - if (CHECK_FLAG(re->status, - ROUTE_ENTRY_REMOVED)) - continue; - if (re->nhe->ifp != ifp) - continue; - if (re->type == ZEBRA_ROUTE_KERNEL) - rib_delete( - afi, SAFI_UNICAST, - zvrf_iter->vrf->vrf_id, - re->type, 0, re->flags, - &rn->p, NULL, &nh, 0, - zvrf_iter->table_id, - re->metric, - re->distance, false); - else if (re->type != - ZEBRA_ROUTE_CONNECT) { - SET_FLAG(re->status, - ROUTE_ENTRY_CHANGED); - UNSET_FLAG( - re->status, - ROUTE_ENTRY_INSTALLED); - rib_add(afi, SAFI_UNICAST, - zvrf_iter->vrf->vrf_id, - re->type, 0, 0, &rn->p, - NULL, &nh, re->nhe_id, - zvrf_iter->table_id, - re->metric, 0, - re->distance, 0, false); - } - } - } - } - } - /* Schedule LSP forwarding entries for processing, if appropriate. */ if (zvrf->vrf->vrf_id == VRF_DEFAULT) { if (IS_ZEBRA_DEBUG_MPLS) |