diff --git a/zebra/rib.h b/zebra/rib.h index 31d9dfd265..9e913f7183 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -372,7 +372,6 @@ extern void _route_entry_dump(const char *func, union prefixconstptr pp, const struct route_entry *re); extern void rib_lookup_and_dump(struct prefix_ipv4 *p, vrf_id_t vrf_id); -extern void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id); #define ZEBRA_RIB_LOOKUP_ERROR -1 #define ZEBRA_RIB_FOUND_EXACT 0 diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 0760b2ebb3..a547a97c24 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -3495,18 +3495,6 @@ enum zebra_dplane_result dplane_intf_addr_set(const struct interface *ifp, return ZEBRA_DPLANE_REQUEST_FAILURE; } - - /* Ensure that no existing installed v4 route conflicts with - * the new interface prefix. This check must be done in the - * zebra pthread context, and any route delete (if needed) - * is enqueued before the interface address programming attempt. - */ - if (ifc->address->family == AF_INET) { - struct prefix_ipv4 *p; - - p = (struct prefix_ipv4 *)ifc->address; - rib_lookup_and_pushup(p, ifp->vrf_id); - } #endif return intf_addr_update_internal(ifp, ifc, DPLANE_OP_ADDR_INSTALL); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 78b4388985..9a697e1cd8 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -658,46 +658,6 @@ void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re) return; } -/* Uninstall the route from kernel. */ -static void rib_uninstall(struct route_node *rn, struct route_entry *re) -{ - struct rib_table_info *info = srcdest_rnode_table_info(rn); - rib_dest_t *dest = rib_dest_from_rnode(rn); - struct nexthop *nexthop; - - if (dest && dest->selected_fib == re) { - if (info->safi == SAFI_UNICAST) - hook_call(rib_update, rn, "rib_uninstall"); - - /* If labeled-unicast route, uninstall transit LSP. */ - if (zebra_rib_labeled_unicast(re)) - zebra_mpls_lsp_uninstall(info->zvrf, rn, re); - - rib_uninstall_kernel(rn, re); - - dest->selected_fib = NULL; - - /* Free FIB nexthop group, if present */ - if (re->fib_ng.nexthop) { - nexthops_free(re->fib_ng.nexthop); - re->fib_ng.nexthop = NULL; - } - UNSET_FLAG(re->status, ROUTE_ENTRY_USE_FIB_NHG); - - for (ALL_NEXTHOPS(re->nhe->nhg, nexthop)) - UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB); - } - - if (CHECK_FLAG(re->flags, ZEBRA_FLAG_SELECTED)) { - const struct prefix *p, *src_p; - - srcdest_rnode_prefixes(rn, &p, &src_p); - - redistribute_delete(p, src_p, re, NULL); - UNSET_FLAG(re->flags, ZEBRA_FLAG_SELECTED); - } -} - /* * rib_can_delete_dest * @@ -3362,58 +3322,6 @@ void rib_lookup_and_dump(struct prefix_ipv4 *p, vrf_id_t vrf_id) } } -/* Check if requested address assignment will fail due to another - * route being installed by zebra in FIB already. Take necessary - * actions, if needed: remove such a route from FIB and deSELECT - * corresponding RE entry. Then put affected RN into RIBQ head. - */ -void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id) -{ - struct route_table *table; - struct route_node *rn; - rib_dest_t *dest; - - if (NULL == (table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id))) { - struct vrf *vrf = vrf_lookup_by_id(vrf_id); - - flog_err(EC_ZEBRA_TABLE_LOOKUP_FAILED, - "%s:%s(%u) zebra_vrf_table() returned NULL", __func__, - VRF_LOGNAME(vrf), vrf_id); - return; - } - - /* No matches would be the simplest case. */ - if (NULL == (rn = route_node_lookup(table, (struct prefix *)p))) - return; - - /* Unlock node. */ - route_unlock_node(rn); - - dest = rib_dest_from_rnode(rn); - /* Check all RE entries. In case any changes have to be done, requeue - * the RN into RIBQ head. If the routing message about the new connected - * route (generated by the IP address we are going to assign very soon) - * comes before the RIBQ is processed, the new RE entry will join - * RIBQ record already on head. This is necessary for proper - * revalidation - * of the rest of the RE. - */ - if (dest->selected_fib) { - if (IS_ZEBRA_DEBUG_RIB) { - struct vrf *vrf = - vrf_lookup_by_id(dest->selected_fib->vrf_id); - - zlog_debug( - "%s(%u):%pFX: freeing way for connected prefix", - VRF_LOGNAME(vrf), dest->selected_fib->vrf_id, - &rn->p); - route_entry_dump(&rn->p, NULL, dest->selected_fib); - } - rib_uninstall(rn, dest->selected_fib); - rib_queue_add(rn); - } -} - /* * Internal route-add implementation; there are a couple of different public * signatures. Callers in this path are responsible for the memory they