mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
zebra: vrf: remove VRF-move static route updating
This was incorrectly implemented to begin with (it only re-added routes, but didn't remove them) and is now covered in static_ifindex_update. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
c3c0406378
commit
6201e30b57
@ -120,8 +120,6 @@ static int if_zebra_new_hook(struct interface *ifp)
|
|||||||
route_table_init_with_delegate(&zebra_if_table_delegate);
|
route_table_init_with_delegate(&zebra_if_table_delegate);
|
||||||
|
|
||||||
ifp->info = zebra_if;
|
ifp->info = zebra_if;
|
||||||
|
|
||||||
zebra_vrf_static_route_interface_fixup(ifp);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -719,6 +717,8 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id)
|
|||||||
|
|
||||||
old_vrf_id = ifp->vrf_id;
|
old_vrf_id = ifp->vrf_id;
|
||||||
|
|
||||||
|
static_ifindex_update(ifp, false);
|
||||||
|
|
||||||
/* Uninstall connected routes. */
|
/* Uninstall connected routes. */
|
||||||
if_uninstall_connected(ifp);
|
if_uninstall_connected(ifp);
|
||||||
|
|
||||||
@ -742,6 +742,8 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id)
|
|||||||
/* Install connected routes (in new VRF). */
|
/* Install connected routes (in new VRF). */
|
||||||
if_install_connected(ifp);
|
if_install_connected(ifp);
|
||||||
|
|
||||||
|
static_ifindex_update(ifp, true);
|
||||||
|
|
||||||
/* Due to connected route change, schedule RIB processing for both old
|
/* Due to connected route change, schedule RIB processing for both old
|
||||||
* and new VRF.
|
* and new VRF.
|
||||||
*/
|
*/
|
||||||
@ -750,8 +752,6 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id)
|
|||||||
ifp->vrf_id, ifp->name);
|
ifp->vrf_id, ifp->name);
|
||||||
rib_update(old_vrf_id, RIB_UPDATE_IF_CHANGE);
|
rib_update(old_vrf_id, RIB_UPDATE_IF_CHANGE);
|
||||||
rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
|
rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
|
||||||
|
|
||||||
zebra_vrf_static_route_interface_fixup(ifp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipv6_ll_address_to_mac(struct in6_addr *address, u_char *mac)
|
static void ipv6_ll_address_to_mac(struct in6_addr *address, u_char *mac)
|
||||||
@ -864,8 +864,6 @@ void if_up(struct interface *ifp)
|
|||||||
ifp->vrf_id, ifp->name);
|
ifp->vrf_id, ifp->name);
|
||||||
rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
|
rib_update(ifp->vrf_id, RIB_UPDATE_IF_CHANGE);
|
||||||
|
|
||||||
zebra_vrf_static_route_interface_fixup(ifp);
|
|
||||||
|
|
||||||
/* Handle interface up for specific types for EVPN. Non-VxLAN interfaces
|
/* Handle interface up for specific types for EVPN. Non-VxLAN interfaces
|
||||||
* are checked to see if (remote) neighbor entries need to be installed
|
* are checked to see if (remote) neighbor entries need to be installed
|
||||||
* on them for ARP suppression.
|
* on them for ARP suppression.
|
||||||
|
@ -95,51 +95,6 @@ static int zebra_vrf_new(struct vrf *vrf)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Moving an interface amongst different vrf's
|
|
||||||
* causes the interface to get a new ifindex
|
|
||||||
* so we need to find static routes with
|
|
||||||
* the old ifindex and replace with new
|
|
||||||
* ifindex to insert back into the table
|
|
||||||
*/
|
|
||||||
void zebra_vrf_static_route_interface_fixup(struct interface *ifp)
|
|
||||||
{
|
|
||||||
afi_t afi;
|
|
||||||
safi_t safi;
|
|
||||||
struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(ifp->vrf_id);
|
|
||||||
struct route_table *stable = NULL;
|
|
||||||
struct route_node *rn = NULL;
|
|
||||||
struct static_route *si = NULL;
|
|
||||||
|
|
||||||
if (!zvrf)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
|
|
||||||
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) {
|
|
||||||
stable = zvrf->stable[afi][safi];
|
|
||||||
if (stable)
|
|
||||||
for (rn = route_top(stable); rn;
|
|
||||||
rn = route_next(rn)) {
|
|
||||||
if (rn->info) {
|
|
||||||
si = rn->info;
|
|
||||||
if ((strcmp(si->ifname,
|
|
||||||
ifp->name)
|
|
||||||
== 0)
|
|
||||||
&& (si->ifindex
|
|
||||||
!= ifp->ifindex)) {
|
|
||||||
si->ifindex =
|
|
||||||
ifp->ifindex;
|
|
||||||
static_install_route(
|
|
||||||
afi, safi,
|
|
||||||
&rn->p, NULL,
|
|
||||||
si);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Callback upon enabling a VRF. */
|
/* Callback upon enabling a VRF. */
|
||||||
static int zebra_vrf_enable(struct vrf *vrf)
|
static int zebra_vrf_enable(struct vrf *vrf)
|
||||||
{
|
{
|
||||||
|
@ -124,7 +124,6 @@ struct route_table *zebra_vrf_table_with_table_id(afi_t afi, safi_t safi,
|
|||||||
vrf_id_t vrf_id,
|
vrf_id_t vrf_id,
|
||||||
u_int32_t table_id);
|
u_int32_t table_id);
|
||||||
|
|
||||||
extern void zebra_vrf_static_route_interface_fixup(struct interface *ifp);
|
|
||||||
extern void zebra_vrf_update_all(struct zserv *client);
|
extern void zebra_vrf_update_all(struct zserv *client);
|
||||||
extern struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id);
|
extern struct zebra_vrf *zebra_vrf_lookup_by_id(vrf_id_t vrf_id);
|
||||||
extern struct zebra_vrf *zebra_vrf_lookup_by_name(const char *);
|
extern struct zebra_vrf *zebra_vrf_lookup_by_name(const char *);
|
||||||
|
Loading…
Reference in New Issue
Block a user