]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: uninstall type-5 routes from vrf
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Mon, 13 Nov 2017 06:48:36 +0000 (22:48 -0800)
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>
Thu, 14 Dec 2017 18:57:08 +0000 (10:57 -0800)
When we receive an MP_UNREACH,
we try to uninstall routes from the VRF and the VNI.
The route-node in the VRF corresponds
to the ip prefix formed from EVPN prefix.
We should correctly form the prefix based on the EVPN route-type.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
bgpd/bgp_evpn.c

index 34fe8811a5adda481338b520f6a6ad1bdb4fb7db..6d898afdd0a932839245d7929ee1c069c973b1ec 100644 (file)
@@ -1854,7 +1854,10 @@ static int uninstall_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
        char buf1[PREFIX_STRLEN];
 
        memset(pp, 0, sizeof(struct prefix));
-       ip_prefix_from_type2_prefix(evp, pp);
+       if (evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE)
+               ip_prefix_from_type2_prefix(evp, pp);
+       else if(evp->prefix.route_type == BGP_EVPN_IP_PREFIX_ROUTE)
+               ip_prefix_from_type5_prefix(evp, pp);
 
        if (bgp_debug_zebra(NULL)) {
                zlog_debug("uninstalling evpn prefix %s as ip prefix %s in vrf %s",
@@ -2108,7 +2111,8 @@ static int install_uninstall_routes_for_vrf(struct bgp *bgp_vrf,
                        struct prefix_evpn *evp = (struct prefix_evpn *)&rn->p;
 
                        /* if not mac-ip route skip this route */
-                       if (evp->prefix.route_type != BGP_EVPN_MAC_IP_ROUTE)
+                       if (!(evp->prefix.route_type == BGP_EVPN_MAC_IP_ROUTE ||
+                             evp->prefix.route_type == BGP_EVPN_IP_PREFIX_ROUTE))
                                continue;
 
                        /* if not a mac+ip route skip this route */