diff options
| author | Anuradha Karuppiah <anuradhak@nvidia.com> | 2021-08-10 08:56:55 -0700 | 
|---|---|---|
| committer | Anuradha Karuppiah <anuradhak@nvidia.com> | 2021-10-15 10:43:41 -0700 | 
| commit | 38f681e1cac07dac996ae952c99684501cf820c6 (patch) | |
| tree | 91454c7fdb906600087f3b3e9b00d7935d7b673d /zebra/zebra_evpn.c | |
| parent | 6e59c4a71dd262f47dabe8286c59536cb417c494 (diff) | |
zebra: ignore sync updates from bgp if the dest ES is not ready
In the window immediately after an ES deletion bgpd can send MAC-IP updates
using that ES. Zebra needs to ignore these updates to prevent creation
of stale entries.
Ticket: #2668488
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Diffstat (limited to 'zebra/zebra_evpn.c')
| -rw-r--r-- | zebra/zebra_evpn.c | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/zebra/zebra_evpn.c b/zebra/zebra_evpn.c index d5e043eea8..4006e1fed5 100644 --- a/zebra/zebra_evpn.c +++ b/zebra/zebra_evpn.c @@ -1423,8 +1423,24 @@ void zebra_evpn_rem_macip_add(vni_t vni, const struct ethaddr *macaddr,  	 * REMOTE - if ES is not local  	 */  	if (flags & ZEBRA_MACIP_TYPE_SYNC_PATH) { -		zebra_evpn_process_sync_macip_add(zevpn, macaddr, ipa_len, -						  ipaddr, flags, seq, esi); +		struct zebra_evpn_es *es; + +		es = zebra_evpn_es_find(esi); +		if (es && (es->flags & ZEBRA_EVPNES_READY_FOR_BGP)) { +			zebra_evpn_process_sync_macip_add(zevpn, macaddr, +							  ipa_len, ipaddr, +							  flags, seq, esi); +		} else { +			if (IS_ZEBRA_DEBUG_EVPN_MH_ES) { +				char esi_str[ESI_STR_LEN]; + +				esi_to_str(esi, esi_str, sizeof(esi_str)); +				zlog_debug( +					"Ignore sync-macip add; ES %s is not ready", +					esi_str); +			} +		} +  		return;  	}  | 
