From: Anuradha Karuppiah Date: Mon, 9 Aug 2021 18:50:22 +0000 (-0700) Subject: zebra: deref the ES on interface delete even if it was not setup as a br-port X-Git-Tag: base_8.2~307^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6e59c4a71dd262f47dabe8286c59536cb417c494;p=matthieu%2Ffrr.git zebra: deref the ES on interface delete even if it was not setup as a br-port This addresses deletion of ES interfaces that are were not completely configured. Ticket: #2668488 Signed-off-by: Anuradha Karuppiah --- diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index e03cf9db06..70382fea6a 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -1050,15 +1050,15 @@ void zebra_evpn_if_cleanup(struct zebra_if *zif) vlanid_t vid; struct zebra_evpn_es *es; - if (!bf_is_inited(zif->vlan_bitmap)) - return; + if (bf_is_inited(zif->vlan_bitmap)) { + bf_for_each_set_bit(zif->vlan_bitmap, vid, IF_VLAN_BITMAP_MAX) + { + zebra_evpn_vl_mbr_deref(vid, zif); + } - bf_for_each_set_bit(zif->vlan_bitmap, vid, IF_VLAN_BITMAP_MAX) { - zebra_evpn_vl_mbr_deref(vid, zif); + bf_free(zif->vlan_bitmap); } - bf_free(zif->vlan_bitmap); - /* Delete associated Ethernet Segment */ es = zif->es_info.es; if (es)