]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix VRF route leaking for multipath routes
authorvivek <vivek@cumulusnetworks.com>
Fri, 6 Apr 2018 16:31:11 +0000 (09:31 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 May 2018 23:24:15 +0000 (19:24 -0400)
Ensure that the next hop of the leaked VRF is not overwritten when the
route is being imported into the target VRF from the VPN table. Also, in
the case of multipath routes, ensure that the nexthop's ifindex is not
inadvertently reset.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
bgpd/bgp_zebra.c
zebra/rt_netlink.c

index a86ea0e52220b41354609b0e29a595217078ea1b..52a246387ee2d945dbf1406c5c797005a06b5db8 100644 (file)
@@ -1287,17 +1287,11 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
                                }
                        }
 
-                       if (bgp->table_map[afi][safi].name || nh_othervrf) {
+                       if (bgp->table_map[afi][safi].name) {
                                /* Copy info and attributes, so the route-map
                                   apply doesn't modify the BGP route info. */
                                local_attr = *mpinfo->attr;
                                mpinfo_cp->attr = &local_attr;
-                               if (nh_othervrf) {
-                                       /* allow route-map to modify */
-                                       local_attr.nexthop =
-                                               info->extra->nexthop_orig.u
-                                                       .prefix4;
-                               }
                        }
 
                        if (bgp->table_map[afi][safi].name) {
@@ -1322,19 +1316,11 @@ void bgp_zebra_announce(struct bgp_node *rn, struct prefix *p,
                        ifindex_t ifindex;
                        struct in6_addr *nexthop;
 
-                       if (bgp->table_map[afi][safi].name || nh_othervrf) {
+                       if (bgp->table_map[afi][safi].name) {
                                /* Copy info and attributes, so the route-map
                                   apply doesn't modify the BGP route info. */
                                local_attr = *mpinfo->attr;
                                mpinfo_cp->attr = &local_attr;
-                               if (nh_othervrf) {
-                                       /* allow route-map to modify */
-                                       local_attr.mp_nexthop_global =
-                                               info->extra->nexthop_orig.u
-                                                       .prefix6;
-                                       local_attr.mp_nexthop_len =
-                                               BGP_ATTR_NHLEN_IPV6_GLOBAL;
-                               }
                        }
 
                        if (bgp->table_map[afi][safi].name) {
index 1d43567ce35674dcda9fb9bb2ddb4c616253adc1..9510a0e12c2b452c02fa25b010d4647c65578b70 100644 (file)
@@ -1233,14 +1233,6 @@ static void _netlink_route_build_multipath(const char *routedesc, int bytelen,
                                "netlink_route_multipath() (%s): "
                                "nexthop via if %u",
                                routedesc, nexthop->ifindex);
-       } else if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) {
-               if (IS_ZEBRA_DEBUG_KERNEL)
-                       zlog_debug(
-                               "netlink_route_multipath() (%s): "
-                               "nexthop via if %u",
-                               routedesc, nexthop->ifindex);
-       } else {
-               rtnh->rtnh_ifindex = 0;
        }
 }