]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: set type-2 route flag if necessary in bgp_zebra_witgdraw
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Tue, 17 Oct 2017 00:31:36 +0000 (17:31 -0700)
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Thu, 14 Dec 2017 18:57:06 +0000 (10:57 -0800)
Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgp_zebra.c

index 1f4fa48194db0222496a730e4917cad43b8220e1..964603d3d934e7648b65f1b388fcd2cfd5c12da4 100644 (file)
@@ -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);