From 595db7f16506d2c82a3478e9f8dab00c8733d386 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 25 May 2003 21:35:06 +0000 Subject: Add back support for null0 interface blackhole routes. --- zebra/rt_netlink.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'zebra/rt_netlink.c') diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 60043c9b..87062dc5 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1174,14 +1174,16 @@ netlink_route (int cmd, int family, void *dest, int length, void *gate, 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 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib, 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); -- cgit v1.2.1