mirror_frr/zebra
anlan_cs 41414503e4 zebra: Fix missing VRF flag
1. No any configuration in FRR, and `ip link add vrf1 type vrf ...`.
Currently, everything is ok.

2.  `ip link del vrf1`.
`zebra` will wrongly/redundantly notify clients to add "vrf1" as a normal
interface after correct deletion of "vrf1".

```
ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-listen (NS 0) type RTM_DELLINK(17), len=588, seq=0, pid=0
ZEBRA: [TDJW2-B9KJW] RTM_DELLINK for vrf1(93) <- Wrongly as normal interface, not vrf
ZEBRA: [WEEJX-M4HA0] interface vrf1 vrf vrf1(93) index 93 is now inactive.
ZEBRA: [NXAHW-290AC] MESSAGE: ZEBRA_INTERFACE_DELETE vrf1 vrf vrf1(93)
ZEBRA: [H97XA-ABB3A] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL vrf1 VRF Id 93 -> 0
ZEBRA: [HP8PZ-7D6D2] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD vrf1 VRF Id 93 -> 0 <-
ZEBRA: [Y6R2N-EF2N4] interface vrf1 is being deleted from the system
ZEBRA: [KNFMR-AFZ53] RTM_DELLINK for VRF vrf1(93)
ZEBRA: [P0CZ5-RF5FH] VRF vrf1 id 93 is now inactive
ZEBRA: [XC3P3-1DG4D] MESSAGE: ZEBRA_VRF_DELETE vrf1
ZEBRA: [ZMS2F-6K837] VRF vrf1 id 4294967295 deleted
OSPF: [JKWE3-97M3J] Zebra: interface add vrf1 vrf default[0] index 0 flags 480 metric 0 mtu 65575 speed 0 <- Wrongly add interface
```

`if_handle_vrf_change()` moved the interface from specific vrf to default
vrf. But it doesn't skip interface of vrf type. So, the wrong/redundant
add operation is done.

Note, the wrong add operation is regarded as an normal interface because
the `ifp->status` is cleared too early, so it is without VRF flag
( `ZEBRA_INTERFACE_VRF_LOOPBACK` ). Now, ospfd will initialize `ifp->type`
to `OSPF_IFTYPE_BROADCAST`.

3. `ip link add vrf1 type vrf ...`, add "vrf1" again. FRR will be with
wrong display:

```
interface vrf1
 ip ospf network broadcast
exit
```

Here, zebra will send `ZEBRA_INTERFACE_ADD` again for "vrf1" with
correct `ifp->status`, so it will be updated into vrf type. But
it can't update `ifp->type` from `OSPF_IFTYPE_BROADCAST` to
`OSPF_IFTYPE_LOOPBACK` because it had been already configured in above
step 2.

Two changes to fix it:

1. Skip the procedure of switching VRF for interfaces of vrf type.
It means, don't send `ZEBRA_INTERFACE_ADD` to clients when deleting vrf.

2. Put the deletion of this flag at the last.
It means, clients should get correct `ifp->status`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-05-01 20:21:37 +08:00
..
dpdk isisd, zebra: Use array_size instead of ARRAY_SIZE 2023-03-31 13:58:47 -04:00
.gitignore *: cleanup .gitignore files 2018-09-08 21:30:42 +02:00
connected.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
connected.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
debug_nl.c *: manual SPDX License ID conversions 2023-02-09 14:09:07 +01:00
debug.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
debug.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
dplane_fpm_nl.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
if_ioctl.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
if_netlink.c zebra: Fix missing VRF flag 2023-05-01 20:21:37 +08:00
if_netlink.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
if_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
if_sysctl.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
interface.c zebra: Fix missing VRF flag 2023-05-01 20:21:37 +08:00
interface.h Merge pull request #12959 from leonshaw/fix/zif-link-nsid 2023-04-11 16:38:33 -05:00
ioctl.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ioctl.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward_proc.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward_sysctl.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
ipforward.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
irdp_interface.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
irdp_main.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
irdp_packet.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
irdp.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
kernel_netlink.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
kernel_netlink.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
kernel_socket.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
kernel_socket.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
label_manager.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
label_manager.h *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
main.c zebra: Cleanup ctx leak on shutdown and turn off event 2023-03-31 09:09:21 -04:00
Makefile build: convert zebra/ to non-recursive build 2017-07-31 23:03:30 +02:00
netconf_netlink.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
netconf_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
redistribute.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
redistribute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rib.h Merge pull request #13145 from donaldsharp/do_delete 2023-04-04 21:10:54 -05:00
router-id.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
router-id.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rt_netlink.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
rt_netlink.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
rt_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rt.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
rtadv.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
rtadv.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
rtread_netlink.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
rtread_sysctl.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
rule_netlink.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rule_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
rule_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
sample_plugin.c *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
subdir.am Merge pull request #12494 from louis-6wind/ext_admin_group 2023-02-15 09:42:03 +01:00
table_manager.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
table_manager.h *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
tc_netlink.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
tc_netlink.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
tc_socket.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
testrib.conf zebra: Build the test client, can be useful, and add IPv6 to testrib.conf 2016-05-26 01:13:58 +00:00
zapi_msg.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
zapi_msg.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_affinitymap.c lib,zebra: add affinity-map configuration hooks 2023-02-10 13:52:01 +01:00
zebra_affinitymap.h lib,zebra: add affinity-map configuration hooks 2023-02-10 13:52:01 +01:00
zebra_dplane.c zebra: ctx has to be non NULL at this point 2023-04-21 08:54:51 -04:00
zebra_dplane.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
zebra_errors.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_errors.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_evpn_mac.c zebra:fix evpn dup detected local mac del event 2023-04-20 15:45:39 -07:00
zebra_evpn_mac.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
zebra_evpn_mh.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_evpn_mh.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
zebra_evpn_neigh.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_evpn_neigh.h *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_evpn_vxlan.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_evpn.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_evpn.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_fpm_dt.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm_netlink.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm_protobuf.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_fpm.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
zebra_gr.c zebra: null-check client pointer during GR processing 2023-04-05 12:30:52 -04:00
zebra_l2_bridge_if.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
zebra_l2_bridge_if.h zebra: multiple vlan aware bridge data structure and related changes 2023-02-13 18:12:04 -05:00
zebra_l2.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_l2.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_mlag_private.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
zebra_mlag_vty.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mlag_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mlag.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_mlag.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_netlink.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_null.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_openbsd.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mpls_vty.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
zebra_mpls.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
zebra_mpls.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_mroute.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_mroute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nb_config.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_nb_rpcs.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nb_state.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_nb.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_nb.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_neigh.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_neigh.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_netns_id.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_netns_id.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_netns_notify.c *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
zebra_netns_notify.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nhg_private.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_nhg.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_nhg.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
zebra_ns.c Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_ns.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
zebra_opaque.c *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
zebra_opaque.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_pbr.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_pbr.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_ptm_redistribute.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_ptm_redistribute.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_ptm.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_ptm.h ripd: support BFD integration 2023-04-19 09:15:01 -03:00
zebra_pw.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
zebra_pw.h *: Rename struct thread to struct event 2023-03-24 08:32:17 -04:00
zebra_rib.c zebra: Actually free up memory associated with the mq list 2023-04-12 10:41:42 -04:00
zebra_rnh.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
zebra_rnh.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap_nb_config.c zebra: remove checks for src address existence when using "set src" 2021-08-02 18:35:30 +03:00
zebra_routemap_nb.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap_nb.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_routemap.c Merge pull request #12837 from donaldsharp/unlikely_routemap 2023-04-04 08:20:25 -04:00
zebra_routemap.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_router.c *: Convert THREAD_XXX macros to EVENT_XXX macros 2023-03-24 08:32:17 -04:00
zebra_router.h *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
zebra_script.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_script.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_snmp.c *: Convert struct event_master to struct event_loop 2023-03-24 08:32:17 -04:00
zebra_srte.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srte.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6_vty.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6_vty.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_srv6.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_tc.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_tc.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_trace.c zebra: Add initial zebra tracepoint support 2022-04-20 09:39:47 -04:00
zebra_trace.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_vrf.c *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_vrf.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00
zebra_vty.c zebra: Use zebra_vrf_lookup_by_id when we can 2023-03-28 15:49:50 -04:00
zebra_vxlan_if.c *: Add a hash_clean_and_free() function 2023-03-21 08:54:21 -04:00
zebra_vxlan_if.h zebra: Fix for mcast-group update and delete per vni for svd 2023-02-13 18:12:05 -05:00
zebra_vxlan_private.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zebra_vxlan.c zebra:return empty dict when evpn is disabled 2023-04-04 19:41:25 -07:00
zebra_vxlan.h Merge pull request #12780 from opensourcerouting/spdx-license-id 2023-02-17 09:43:05 -05:00
zserv.c zebra: remove current_afi as that it is no longer used 2023-03-29 15:40:56 -04:00
zserv.h zebra: remove current_afi as that it is no longer used 2023-03-29 15:40:56 -04:00