summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2022-03-04 14:52:27 +0100
committeranlan_cs <anlan_cs@tom.com>2023-10-07 04:06:39 +0200
commitb580c52698287c24e41b6c5b190c2ddddc336f4c (patch)
tree34f270ed0e4bc62a5ae7724f3dd07d3b91bec608 /pbrd
parentMerge pull request #13814 from pguibert6WIND/comm_list_expanded_match_no_exact (diff)
downloadfrr-b580c52698287c24e41b6c5b190c2ddddc336f4c.tar.xz
frr-b580c52698287c24e41b6c5b190c2ddddc336f4c.zip
*: remove ZEBRA_INTERFACE_VRF_UPDATE
Currently when one interface changes its VRF, zebra will send these messages to all daemons in *order*: 1) `ZEBRA_INTERFACE_DELETE` ( notify them delete from old VRF ) 2) `ZEBRA_INTERFACE_VRF_UPDATE` ( notify them move from old to new VRF ) 3) `ZEBRA_INTERFACE_ADD` ( notify them added into new VRF ) When daemons deal with `VRF_UPDATE`, they use `zebra_interface_vrf_update_read()->if_lookup_by_name()` to check the interface exist or not in old VRF. This check will always return *NULL* because `DELETE` ( deleted from old VRF ) is already done, so can't find this interface in old VRF. Send `VRF_UPDATE` is redundant and unuseful. `DELETE` and `ADD` are enough, they will deal with RB tree, so don't send this `VRF_UPDATE` message when vrf changes. Since all daemons have good mechanism to deal with changing vrf, and don't use this `VRF_UPDATE` mechanism. So, it is safe to completely remove all the code with `VRF_UPDATE`. Signed-off-by: anlan_cs <anlan_cs@tom.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_zebra.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index e8a49b317..876f9e19e 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -129,29 +129,6 @@ int pbr_ifp_down(struct interface *ifp)
return 0;
}
-static int interface_vrf_update(ZAPI_CALLBACK_ARGS)
-{
- struct interface *ifp;
- vrf_id_t new_vrf_id;
-
- ifp = zebra_interface_vrf_update_read(zclient->ibuf, vrf_id,
- &new_vrf_id);
-
- if (!ifp) {
- DEBUGD(&pbr_dbg_zebra, "%s: VRF change interface not found",
- __func__);
-
- return 0;
- }
-
- DEBUGD(&pbr_dbg_zebra, "%s: %s VRF change %u -> %u", __func__,
- ifp->name, vrf_id, new_vrf_id);
-
- if_update_to_new_vrf(ifp, new_vrf_id);
-
- return 0;
-}
-
static int route_notify_owner(ZAPI_CALLBACK_ARGS)
{
struct prefix p;
@@ -436,7 +413,6 @@ extern struct zebra_privs_t pbr_privs;
static zclient_handler *const pbr_handlers[] = {
[ZEBRA_INTERFACE_ADDRESS_ADD] = interface_address_add,
[ZEBRA_INTERFACE_ADDRESS_DELETE] = interface_address_delete,
- [ZEBRA_INTERFACE_VRF_UPDATE] = interface_vrf_update,
[ZEBRA_ROUTE_NOTIFY_OWNER] = route_notify_owner,
[ZEBRA_RULE_NOTIFY_OWNER] = rule_notify_owner,
[ZEBRA_NEXTHOP_UPDATE] = pbr_zebra_nexthop_update,