From: Christian Franke Date: Fri, 5 Jul 2013 15:35:38 +0000 (+0000) Subject: zebra: handle blackholes encountered in recursive resolution X-Git-Tag: frr-2.0-rc1~1639 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=48a53dc71cb422e619859b79d5069e02fcd867d0;p=mirror%2Ffrr.git zebra: handle blackholes encountered in recursive resolution Signed-off-by: Christian Franke Signed-off-by: David Lamparter --- diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index e39976ee55..301e0cc1db 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -472,6 +472,12 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, } else { + /* If the longest prefix match for the nexthop yields + * a blackhole, mark it as inactive. */ + if (CHECK_FLAG (match->flags, ZEBRA_FLAG_BLACKHOLE) + || CHECK_FLAG (match->flags, ZEBRA_FLAG_REJECT)) + return 0; + if (match->type == ZEBRA_ROUTE_CONNECT) { /* Directly point connected route. */ @@ -587,6 +593,12 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, } else { + /* If the longest prefix match for the nexthop yields + * a blackhole, mark it as inactive. */ + if (CHECK_FLAG (match->flags, ZEBRA_FLAG_BLACKHOLE) + || CHECK_FLAG (match->flags, ZEBRA_FLAG_REJECT)) + return 0; + if (match->type == ZEBRA_ROUTE_CONNECT) { /* Directly point connected route. */