From b580c52698287c24e41b6c5b190c2ddddc336f4c Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Fri, 4 Mar 2022 21:52:27 +0800 Subject: *: 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 --- zebra/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 92ae8a9dc5..919cd11bc8 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -853,7 +853,7 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id) if_down_del_nbr_connected(ifp); /* Send out notification on interface VRF change. */ - /* This is to issue an UPDATE or a DELETE, as appropriate. */ + /* This is to issue a DELETE, as appropriate. */ zebra_interface_vrf_update_del(ifp, vrf_id); if (if_is_vrf(ifp)) -- cgit v1.2.3