mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 20:55:25 +00:00
Merge pull request #5553 from slankdev/slankdev-fix-kernel-route-deletion-on-vrf
zebra: fix kernel-route's deletion on vrf
This commit is contained in:
commit
c4db327d82
@ -787,34 +787,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id,
|
|||||||
} else {
|
} else {
|
||||||
if (!tb[RTA_MULTIPATH]) {
|
if (!tb[RTA_MULTIPATH]) {
|
||||||
struct nexthop nh;
|
struct nexthop nh;
|
||||||
size_t sz = (afi == AFI_IP) ? 4 : 16;
|
|
||||||
|
|
||||||
memset(&nh, 0, sizeof(nh));
|
nh = parse_nexthop_unicast(
|
||||||
if (bh_type == BLACKHOLE_UNSPEC) {
|
ns_id, rtm, tb, bh_type, index, prefsrc,
|
||||||
if (index && !gate)
|
gate, afi, vrf_id);
|
||||||
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 {
|
|
||||||
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);
|
|
||||||
rib_delete(afi, SAFI_UNICAST, vrf_id, proto, 0,
|
rib_delete(afi, SAFI_UNICAST, vrf_id, proto, 0,
|
||||||
flags, &p, &src_p, &nh, 0, table,
|
flags, &p, &src_p, &nh, 0, table,
|
||||||
metric, distance, true);
|
metric, distance, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user