]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Allow static non interface based routes to leak
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 11 Jan 2018 16:51:46 +0000 (11:51 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 12 Jan 2018 14:26:42 +0000 (09:26 -0500)
Allow this to work:

vrf DONNA
  ip route 4.3.2.1/32 192.168.1.5 nexthop-vrf EVA

The static route code was not properly telling the
nexthop resolution code what vrf to use.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_rib.c
zebra/zebra_routemap.c
zebra/zebra_static.c

index fd1b273c8e0721bf5cd5ec000c27f5fff3cbe5c1..16dafa6b89e830e54a354eecf1d8c8200de2e29e 100644 (file)
@@ -397,7 +397,7 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
 
        if (set) {
                UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE);
-               zebra_deregister_rnh_static_nexthops(re->vrf_id,
+               zebra_deregister_rnh_static_nexthops(re->nh_vrf_id,
                                                     nexthop->resolved, top);
                nexthops_free(nexthop->resolved);
                nexthop->resolved = NULL;
@@ -904,7 +904,7 @@ static unsigned nexthop_active_check(struct route_node *rn,
        memset(&nexthop->rmap_src.ipv6, 0, sizeof(union g_addr));
 
        /* It'll get set if required inside */
-       ret = zebra_route_map_check(family, re->type, p, nexthop, re->vrf_id,
+       ret = zebra_route_map_check(family, re->type, p, nexthop, re->nh_vrf_id,
                                    re->tag);
        if (ret == RMAP_DENYMATCH) {
                if (IS_ZEBRA_DEBUG_RIB) {
index 61af60b5da1e3ccd1d4dc16fc24d23a8799c246d..89cb2fc4881efb5dae49482f55f44947c0c605bf 100644 (file)
@@ -1329,7 +1329,7 @@ route_map_result_t zebra_nht_route_map_check(int family, int client_proto,
        struct nh_rmap_obj nh_obj;
 
        nh_obj.nexthop = nexthop;
-       nh_obj.vrf_id = re->vrf_id;
+       nh_obj.vrf_id = re->nh_vrf_id;
        nh_obj.source_protocol = re->type;
        nh_obj.metric = re->metric;
        nh_obj.tag = re->tag;
index 3423518bba58a2c85bd7279a9959b56616c9d9de..fa5f0d9c48b52307597521fa06c85ef5665e0a96 100644 (file)
@@ -91,7 +91,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
                        nh_p.family = AF_INET;
                        nh_p.prefixlen = IPV4_MAX_BITLEN;
                        nh_p.u.prefix4 = si->addr.ipv4;
-                       zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);
+                       zebra_register_rnh_static_nh(si->nh_vrf_id, &nh_p, rn);
                        break;
                case STATIC_IPV4_GATEWAY_IFNAME:
                        nexthop = route_entry_nexthop_ipv4_ifindex_add(
@@ -111,7 +111,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
                        nh_p.family = AF_INET6;
                        nh_p.prefixlen = IPV6_MAX_BITLEN;
                        nh_p.u.prefix6 = si->addr.ipv6;
-                       zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);
+                       zebra_register_rnh_static_nh(si->nh_vrf_id, &nh_p, rn);
                        break;
                case STATIC_IPV6_GATEWAY_IFNAME:
                        nexthop = route_entry_nexthop_ipv6_ifindex_add(
@@ -141,7 +141,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
                 */
                if (si->type == STATIC_IPV4_GATEWAY
                    || si->type == STATIC_IPV6_GATEWAY)
-                       zebra_evaluate_rnh(si->vrf_id, nh_p.family, 1,
+                       zebra_evaluate_rnh(si->nh_vrf_id, nh_p.family, 1,
                                           RNH_NEXTHOP_TYPE, &nh_p);
                else
                        rib_queue_add(rn);
@@ -170,7 +170,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
                        nh_p.family = AF_INET;
                        nh_p.prefixlen = IPV4_MAX_BITLEN;
                        nh_p.u.prefix4 = si->addr.ipv4;
-                       zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);
+                       zebra_register_rnh_static_nh(si->nh_vrf_id, &nh_p, rn);
                        break;
                case STATIC_IPV4_GATEWAY_IFNAME:
                        nexthop = route_entry_nexthop_ipv4_ifindex_add(
@@ -190,7 +190,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
                        nh_p.family = AF_INET6;
                        nh_p.prefixlen = IPV6_MAX_BITLEN;
                        nh_p.u.prefix6 = si->addr.ipv6;
-                       zebra_register_rnh_static_nh(si->vrf_id, &nh_p, rn);
+                       zebra_register_rnh_static_nh(si->nh_vrf_id, &nh_p, rn);
                        break;
                case STATIC_IPV6_GATEWAY_IFNAME:
                        nexthop = route_entry_nexthop_ipv6_ifindex_add(
@@ -222,7 +222,7 @@ void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
                if (si->type == STATIC_IPV4_GATEWAY
                    || si->type == STATIC_IPV6_GATEWAY) {
                        rib_addnode(rn, re, 0);
-                       zebra_evaluate_rnh(si->vrf_id, nh_p.family, 1,
+                       zebra_evaluate_rnh(si->nh_vrf_id, nh_p.family, 1,
                                           RNH_NEXTHOP_TYPE, &nh_p);
                } else
                        rib_addnode(rn, re, 1);