zebra: fix misc problems with ES management

1. MAC ref of a zero ESI was accidentally creating a new ES with zero
ES id.
2. When an ES was deleted and re-added the ES was not being sent to BGP
because of a stale flag that suppressed the update as a dup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
This commit is contained in:
Anuradha Karuppiah 2020-04-08 08:10:13 -07:00
parent 3fb5678572
commit 4cd940502d

View File

@ -1356,7 +1356,8 @@ static void zebra_evpn_es_local_info_clear(struct zebra_evpn_es *es)
if (!(es->flags & ZEBRA_EVPNES_LOCAL)) if (!(es->flags & ZEBRA_EVPNES_LOCAL))
return; return;
es->flags &= ~ZEBRA_EVPNES_LOCAL; es->flags &= ~(ZEBRA_EVPNES_LOCAL | ZEBRA_EVPNES_READY_FOR_BGP);
/* if there any local macs referring to the ES as dest we /* if there any local macs referring to the ES as dest we
* need to clear the static reference on them * need to clear the static reference on them
*/ */
@ -1613,9 +1614,13 @@ bool zebra_evpn_es_mac_ref(zebra_mac_t *mac, esi_t *esi)
es = zebra_evpn_es_find(esi); es = zebra_evpn_es_find(esi);
if (!es) { if (!es) {
es = zebra_evpn_es_new(esi); /* If non-zero esi implicitly create a new ES */
if (IS_ZEBRA_DEBUG_EVPN_MH_ES) if (memcmp(esi, zero_esi, sizeof(esi_t))) {
zlog_debug("auto es %s add on mac ref", es->esi_str); es = zebra_evpn_es_new(esi);
if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
zlog_debug("auto es %s add on mac ref",
es->esi_str);
}
} }
return zebra_evpn_es_mac_ref_entry(mac, es); return zebra_evpn_es_mac_ref_entry(mac, es);