]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Allow recursive nexthop resolution to consider blackholes
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 12 Sep 2017 12:18:39 +0000 (08:18 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 12 Sep 2017 12:33:37 +0000 (08:33 -0400)
When we get a route install for a route that needs to be recursively
resolved allow the blackhole to be considered and used if it is
available.

This allows bgp to install a route that will be blackholed.

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

index c4c80b156b796c9c0188b5e027c6ade99feab422..d947db066fa40aaa2d1f9763837ded520e0006e9 100644 (file)
@@ -357,6 +357,10 @@ static void nexthop_set_resolved(afi_t afi, struct nexthop *newhop,
                resolved_hop->ifindex = newhop->ifindex;
        }
 
+       if (newhop->type == NEXTHOP_TYPE_BLACKHOLE) {
+               resolved_hop->type = NEXTHOP_TYPE_BLACKHOLE;
+               resolved_hop->bh_type = nexthop->bh_type;
+       }
        resolved_hop->rparent = nexthop;
        nexthop_add(&nexthop->resolved, resolved_hop);
 }
@@ -484,8 +488,6 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
                } else if (CHECK_FLAG(re->flags, ZEBRA_FLAG_INTERNAL)) {
                        resolved = 0;
                        for (ALL_NEXTHOPS(match->nexthop, newhop)) {
-                               if (newhop->type == NEXTHOP_TYPE_BLACKHOLE)
-                                       continue;
                                if (!CHECK_FLAG(newhop->flags,
                                                NEXTHOP_FLAG_FIB))
                                        continue;
@@ -509,8 +511,6 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
                } else if (re->type == ZEBRA_ROUTE_STATIC) {
                        resolved = 0;
                        for (ALL_NEXTHOPS(match->nexthop, newhop)) {
-                               if (newhop->type == NEXTHOP_TYPE_BLACKHOLE)
-                                       continue;
                                if (!CHECK_FLAG(newhop->flags,
                                                NEXTHOP_FLAG_FIB))
                                        continue;