Add back support for null0 interface blackhole routes.
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 60043c9..87062dc 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1174,14 +1174,16 @@
req.r.rtm_protocol = RTPROT_ZEBRA;
req.r.rtm_scope = RT_SCOPE_UNIVERSE;
- if (discard) {
- if (zebra_flags & ZEBRA_FLAG_BLACKHOLE)
- req.r.rtm_type = RTN_BLACKHOLE;
- else if (zebra_flags & ZEBRA_FLAG_REJECT)
- req.r.rtm_type = RTN_UNREACHABLE;
- else assert(RTN_BLACKHOLE != RTN_UNREACHABLE); /* false */
- } else
- req.r.rtm_type = RTN_UNICAST;
+ if (discard)
+ {
+ if (zebra_flags & ZEBRA_FLAG_BLACKHOLE)
+ req.r.rtm_type = RTN_BLACKHOLE;
+ else if (zebra_flags & ZEBRA_FLAG_REJECT)
+ req.r.rtm_type = RTN_UNREACHABLE;
+ else assert(RTN_BLACKHOLE != RTN_UNREACHABLE); /* false */
+ }
+ else
+ req.r.rtm_type = RTN_UNICAST;
}
if (dest)
@@ -1252,14 +1254,16 @@
req.r.rtm_protocol = RTPROT_ZEBRA;
req.r.rtm_scope = RT_SCOPE_UNIVERSE;
- if (discard) {
- if (rib->flags & ZEBRA_FLAG_BLACKHOLE)
- req.r.rtm_type = RTN_BLACKHOLE;
- else if (rib->flags & ZEBRA_FLAG_REJECT)
- req.r.rtm_type = RTN_UNREACHABLE;
- else assert(RTN_BLACKHOLE != RTN_UNREACHABLE); /* false */
- } else
- req.r.rtm_type = RTN_UNICAST;
+ if (discard)
+ {
+ if (rib->flags & ZEBRA_FLAG_BLACKHOLE)
+ req.r.rtm_type = RTN_BLACKHOLE;
+ else if (rib->flags & ZEBRA_FLAG_REJECT)
+ req.r.rtm_type = RTN_UNREACHABLE;
+ else assert(RTN_BLACKHOLE != RTN_UNREACHABLE); /* false */
+ }
+ else
+ req.r.rtm_type = RTN_UNICAST;
}
addattr_l (&req.n, sizeof req, RTA_DST, &p->u.prefix, bytelen);