summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-03 17:59:14 -0400
committerGitHub <noreply@github.com>2017-09-03 17:59:14 -0400
commit650e74d71a2faa6536de4d3043aebe306ee3db1d (patch)
treeef920bad56027acd8e6a0cfe2b88123694e6e1e4 /zebra/rt_netlink.c
parentd8ed14299c2dc24245c7251c53d6b12335da3a4b (diff)
parent5f20552d51647a7ab672b9e7dbdf7de757c9fb29 (diff)
Merge pull request #1090 from opensourcerouting/rib_issues
RIB issues
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index c58a7aa2fa..f05025e630 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -491,17 +491,26 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
size_t sz = (afi == AFI_IP) ? 4 : 16;
memset(&nh, 0, sizeof(nh));
- if (index && !gate)
- nh.type = NEXTHOP_TYPE_IFINDEX;
- else if (index && gate)
- nh.type = (afi == AFI_IP)
- ? NEXTHOP_TYPE_IPV4_IFINDEX
- : NEXTHOP_TYPE_IPV6_IFINDEX;
- else if (!index && gate)
- nh.type = (afi == AFI_IP) ? NEXTHOP_TYPE_IPV4
+ if (bh_type == BLACKHOLE_UNSPEC) {
+ if (index && !gate)
+ nh.type = NEXTHOP_TYPE_IFINDEX;
+ else if (index && gate)
+ nh.type =
+ (afi == AFI_IP)
+ ? NEXTHOP_TYPE_IPV4_IFINDEX
+ : NEXTHOP_TYPE_IPV6_IFINDEX;
+ else if (!index && gate)
+ nh.type = (afi == AFI_IP)
+ ? NEXTHOP_TYPE_IPV4
: NEXTHOP_TYPE_IPV6;
- else
+ else {
+ nh.type = NEXTHOP_TYPE_BLACKHOLE;
+ nh.bh_type = BLACKHOLE_UNSPEC;
+ }
+ } else {
nh.type = NEXTHOP_TYPE_BLACKHOLE;
+ nh.bh_type = bh_type;
+ }
nh.ifindex = index;
if (gate)
memcpy(&nh.gate, gate, sz);