Repository navigation
zebra: fix upon detach vxlan interface, bridge present in zevpn ctx - #236
mwinter-osr wants to merge 1 commit into
Conversation
In an evpn context, when detaching a vxlan interface from a bridged interface, then the context remains with the bridged interface: > ip link set dev vxlan101 nomaster > [..] > PE1# show evpn vni > VNI Type VxLAN IF # MACs # ARPs # Remote VTEPs Tenant VRF VLAN BRIDGE > 101 L2 vxlan101 0 0 0 default 1 br101 Fix this by removing the bridge pointer. Fixes: b7cfce9 ("zebra, lib: zebra changes for symmetric routing support") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Loïc Sang <loic.sang@6wind.com>
Greptile SummaryAdds a single-line fix —
|
| Filename | Overview |
|---|---|
| zebra/zebra_vxlan_if.c | Adds one-line fix clearing zevpn->bridge_if in the L2-VNI "removed from bridge" update path; analogous L3-VNI path (line 248) has the same unfixed gap, and no topotest accompanies the fix. |
Sequence Diagram
sequenceDiagram
participant Kernel as Linux Kernel
participant ZIF as zebra_vxlan_if.c
participant ZEVPN as zevpn (L2-VNI ctx)
participant BGP as BGP Client
Note over Kernel,BGP: ip link set dev vxlan101 nomaster
Kernel->>ZIF: "netlink MASTER_CHANGE (bridge_ifindex=IFINDEX_INTERNAL)"
ZIF->>ZIF: "zebra_vxlan_if_update_vni()<br/>chgflags has ZEBRA_VXLIF_MASTER_CHANGE"
Note over ZIF: L2-VNI path (BEFORE fix)
ZIF->>ZEVPN: "svi_if = NULL"
ZIF->>BGP: zebra_evpn_send_del_to_client()
ZIF->>ZEVPN: neigh/mac/vtep del_all()
Note over ZEVPN: bridge_if still points to br101 ← stale!
ZIF->>ZIF: return 0
Note over ZIF: L2-VNI path (AFTER fix — this PR)
ZIF->>ZEVPN: "svi_if = NULL"
ZIF->>BGP: zebra_evpn_send_del_to_client()
ZIF->>ZEVPN: neigh/mac/vtep del_all()
ZIF->>ZEVPN: "zevpn_bridge_if_set(false) → bridge_if = NULL ✓"
ZIF->>ZIF: return 0
Comments Outside Diff (1)
-
zebra/zebra_vxlan_if.c, line 246-249 (link)L3-VNI path has the same stale-bridge-pointer bug
The symmetric L3-VNI "removed from bridge" early-return path only calls
zebra_vxlan_process_l3vni_oper_down()and returns without clearingzl3vni->bridge_if. Afterip link set dev <vxlan> nomasteron an L3-VNI interface,show evpn vni detailwill still display the stale bridge name — the identical symptom this PR fixes for L2-VNI. The fix pattern is already established:if (CHECK_FLAG(chgflags, ZEBRA_VXLIF_MASTER_CHANGE) && (zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) { zebra_vxlan_process_l3vni_oper_down(zl3vni); zl3vni_bridge_if_set(zl3vni, zl3vni->bridge_if, false /* unset */); return 0; }
Prompt To Fix With AI
This is a comment left during a code review. Path: zebra/zebra_vxlan_if.c Line: 246-249 Comment: **L3-VNI path has the same stale-bridge-pointer bug** The symmetric L3-VNI "removed from bridge" early-return path only calls `zebra_vxlan_process_l3vni_oper_down()` and returns without clearing `zl3vni->bridge_if`. After `ip link set dev <vxlan> nomaster` on an L3-VNI interface, `show evpn vni detail` will still display the stale bridge name — the identical symptom this PR fixes for L2-VNI. The fix pattern is already established: ```c if (CHECK_FLAG(chgflags, ZEBRA_VXLIF_MASTER_CHANGE) && (zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) { zebra_vxlan_process_l3vni_oper_down(zl3vni); zl3vni_bridge_if_set(zl3vni, zl3vni->bridge_if, false /* unset */); return 0; } ``` How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: zebra/zebra_vxlan_if.c
Line: 330-331
Comment:
**No topotest for the fixed scenario**
This bug is fully reproducible with `ip link set dev vxlan101 nomaster` in an EVPN context, yet no topotest is added to prevent regression. Per FRR policy, every bug fix must be accompanied by a topotest. The existing EVPN topotest suites (`bgp_evpn_mh`, `bgp_evpn_vxlan_topo1`) would be natural homes for a test that attaches, verifies the bridge pointer, detaches, and verifies `show evpn vni` shows no BRIDGE field.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: zebra/zebra_vxlan_if.c
Line: 246-249
Comment:
**L3-VNI path has the same stale-bridge-pointer bug**
The symmetric L3-VNI "removed from bridge" early-return path only calls `zebra_vxlan_process_l3vni_oper_down()` and returns without clearing `zl3vni->bridge_if`. After `ip link set dev <vxlan> nomaster` on an L3-VNI interface, `show evpn vni detail` will still display the stale bridge name — the identical symptom this PR fixes for L2-VNI. The fix pattern is already established:
```c
if (CHECK_FLAG(chgflags, ZEBRA_VXLIF_MASTER_CHANGE) &&
(zif->brslave_info.bridge_ifindex == IFINDEX_INTERNAL)) {
zebra_vxlan_process_l3vni_oper_down(zl3vni);
zl3vni_bridge_if_set(zl3vni, zl3vni->bridge_if, false /* unset */);
return 0;
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "zebra: fix upon detach vxlan interface, ..." | Re-trigger Greptile
| zevpn_bridge_if_set(zevpn, zevpn->bridge_if, false /* unset */); | ||
| return 0; |
There was a problem hiding this comment.
No topotest for the fixed scenario
This bug is fully reproducible with ip link set dev vxlan101 nomaster in an EVPN context, yet no topotest is added to prevent regression. Per FRR policy, every bug fix must be accompanied by a topotest. The existing EVPN topotest suites (bgp_evpn_mh, bgp_evpn_vxlan_topo1) would be natural homes for a test that attaches, verifies the bridge pointer, detaches, and verifies show evpn vni shows no BRIDGE field.
Prompt To Fix With AI
This is a comment left during a code review.
Path: zebra/zebra_vxlan_if.c
Line: 330-331
Comment:
**No topotest for the fixed scenario**
This bug is fully reproducible with `ip link set dev vxlan101 nomaster` in an EVPN context, yet no topotest is added to prevent regression. Per FRR policy, every bug fix must be accompanied by a topotest. The existing EVPN topotest suites (`bgp_evpn_mh`, `bgp_evpn_vxlan_topo1`) would be natural homes for a test that attaches, verifies the bridge pointer, detaches, and verifies `show evpn vni` shows no BRIDGE field.
How can I resolve this? If you propose a fix, please make it concise.
In an evpn context, when detaching a vxlan interface from a bridged interface, then the context remains with the bridged interface:
Fix this by removing the bridge pointer.
Fixes: b7cfce9 ("zebra, lib: zebra changes for symmetric routing support")
Original PR20974 by lsang6WIND