Merge pull request #7217 from AnuradhaKaruppiah/fix-es-del-regression

zebra: fix double clearing of zif->es_info.es
This commit is contained in:
Patrick Ruddy 2020-10-26 10:12:54 +00:00 committed by GitHub
commit d7bd0c043c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -810,6 +810,7 @@ void zebra_evpn_if_init(struct zebra_if *zif)
void zebra_evpn_if_cleanup(struct zebra_if *zif) void zebra_evpn_if_cleanup(struct zebra_if *zif)
{ {
vlanid_t vid; vlanid_t vid;
struct zebra_evpn_es *es;
if (!bf_is_inited(zif->vlan_bitmap)) if (!bf_is_inited(zif->vlan_bitmap))
return; return;
@ -821,8 +822,9 @@ void zebra_evpn_if_cleanup(struct zebra_if *zif)
bf_free(zif->vlan_bitmap); bf_free(zif->vlan_bitmap);
/* Delete associated Ethernet Segment */ /* Delete associated Ethernet Segment */
if (zif->es_info.es) es = zif->es_info.es;
zebra_evpn_local_es_del(&zif->es_info.es); if (es)
zebra_evpn_local_es_del(&es);
} }
/***************************************************************************** /*****************************************************************************
@ -1450,7 +1452,7 @@ static int zebra_evpn_local_es_update(struct zebra_if *zif, uint32_t lid,
if (!lid || is_zero_mac(sysmac)) { if (!lid || is_zero_mac(sysmac)) {
/* if in ES is attached to zif delete it */ /* if in ES is attached to zif delete it */
if (old_es) if (old_es)
zebra_evpn_local_es_del(&zif->es_info.es); zebra_evpn_local_es_del(&old_es);
return 0; return 0;
} }
@ -1475,7 +1477,7 @@ static int zebra_evpn_local_es_update(struct zebra_if *zif, uint32_t lid,
/* release the old_es against the zif */ /* release the old_es against the zif */
if (old_es) if (old_es)
zebra_evpn_local_es_del(&zif->es_info.es); zebra_evpn_local_es_del(&old_es);
es = zebra_evpn_es_find(&esi); es = zebra_evpn_es_find(&esi);
if (es) { if (es) {