Skip to content

Commit

Permalink
bgpd: Fix for local interface MAC cache issue in 'bgp mac hash' table
Browse files Browse the repository at this point in the history
Issue:
During FRR restart, we fail to add some of the local interface's MAC
to the 'bgp mac hash'. Not having local MAC in the hash table can cause
lookup issues while receiving EVPN RT-2.

Currently, we have code to add local MAC(bgp_mac_add_mac_entry) while handling
interface add/up events in BGP(bgp_ifp_up/bgp_ifp_create). But the code
'bgp_mac_add_mac_entry' in bgp_ifp_create is not getting invoked as it
is placed under a specific check(vrf->bgp link check).

Fix:
We can skip this check 'vrf->bgp link existence' as the tenant VRF might
not have BGP instance but still we want to cache the tenant VRF local
MACs. So keeping this check in bgp_ifp_create inline with bgp_ifp_up.

Ticket: #4204154

Signed-off-by: Krishnasamy R <[email protected]>
(cherry picked from commit 0165283)
  • Loading branch information
krishna-samy authored and mergify[bot] committed Jan 21, 2025
1 parent ddff9fb commit bd9a103
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -3333,12 +3333,15 @@ static int bgp_ifp_create(struct interface *ifp)
zlog_debug("Rx Intf add VRF %s IF %s", ifp->vrf->name,
ifp->name);

/* We don't need to check for vrf->bgp link to add this local MAC
* to the hash table as the tenant VRF might not have the BGP instance.
*/
bgp_mac_add_mac_entry(ifp);

bgp = ifp->vrf->info;
if (!bgp)
return 0;

bgp_mac_add_mac_entry(ifp);

bgp_update_interface_nbrs(bgp, ifp, ifp);
hook_call(bgp_vrf_status_changed, bgp, ifp);

Expand Down

0 comments on commit bd9a103

Please sign in to comment.