mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 10:14:50 +00:00
zebra: allow blackhole routes from the kernel to be deleted
Fixes the following bug: % ip -6 route add unreachable 4000::/64 % ip -6 route del unreachable 4000::/64 % vtysh -c "show ipv6 route" [snip] K>* 4000::/64 [0/1024] unreachable (ICMP unreachable) Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
a3d18ce6b0
commit
8ba5bd58aa
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user