Skip to content

Commit

Permalink
zebra: fix the access-vlan vni refcount on bridge flap
Browse files Browse the repository at this point in the history
The issue is with receiving duplicate message which results in
increment of ref-count of the vni for the same (vlan,vni) mapping.
Moved the current check to catch duplicate messages before ref count
processing.

Ticket:#3145214
Testing Done: UT

Signed-off-by: Ashwini Reddy <[email protected]>
  • Loading branch information
ashred-lnx authored and donaldsharp committed Dec 7, 2024
1 parent 5554aac commit 2ca1247
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions zebra/zebra_evpn_mh.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,14 @@ void zebra_evpn_vl_vxl_ref(uint16_t vid, vni_t vni_id,
acc_bd = zebra_evpn_acc_vl_find(vid, br_if);
if (!acc_bd)
acc_bd = zebra_evpn_acc_bd_alloc_on_ref(vid, br_if);
old_vni = acc_bd->vni;
if (vni_id == old_vni) {
if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
zlog_debug(
"This is a duplicate msg for access_vlan %d VNI %d VNI count: %d",
vid, vni_id, acc_bd->vni_count);
return;
}
/* Check if the current vni is active, if active then we have multiple
* VNI's getting mapped to the same VLAN which is momentary hence
* increment the vni count and return else continue processing as the
Expand All @@ -797,10 +805,6 @@ void zebra_evpn_vl_vxl_ref(uint16_t vid, vni_t vni_id,
vid, tmp_cnt, acc_bd->vni_count);
return;
}
old_vni = acc_bd->vni;

if (vni_id == old_vni)
return;

acc_bd->vni = vni_id;
acc_bd->vxlan_zif = vxlan_zif;
Expand Down

0 comments on commit 2ca1247

Please sign in to comment.