From 01740ff48710ed142e18f098f030141388848101 Mon Sep 17 00:00:00 2001 From: Mitesh Kanjariya Date: Mon, 16 Oct 2017 17:31:36 -0700 Subject: [PATCH] bgpd: set type-2 route flag if necessary in bgp_zebra_witgdraw Signed-off-by: Mitesh Kanjariya --- bgpd/bgp_zebra.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 1f4fa48194..964603d3d9 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1249,11 +1249,18 @@ void bgp_zebra_withdraw(struct prefix *p, struct bgp_info *info, safi_t safi) return; memset(&api, 0, sizeof(api)); + memcpy(&api.rmac, &(info->attr->rmac), sizeof(struct ethaddr)); api.vrf_id = peer->bgp->vrf_id; api.type = ZEBRA_ROUTE_BGP; api.safi = safi; api.prefix = *p; + /* If it is an EVPN route mark as such. + * Currently presence of rmac in attr denotes + * this is an EVPN type-2 route */ + if (!is_zero_mac(&(info->attr->rmac))) + SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_TYPE2_ROUTE); + if (peer->sort == BGP_PEER_IBGP) { SET_FLAG(api.flags, ZEBRA_FLAG_INTERNAL); SET_FLAG(api.flags, ZEBRA_FLAG_IBGP); -- 2.39.5