mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-22 22:03:43 +03:00
network/route: fix reachability check when peer address is specified
When an address with peer address is specified, the kernel by default adds the prefix route for the peer address. When ManageForeignRoute=no is set, then we also needs to check the prefix for the peer address. Fixes #30403. (cherry picked from commit e091ed405353624f2da28e2f3210e205f7eab370) (cherry picked from commit b641ced147d94578375f5e25d616241fef195a4a)
This commit is contained in:
parent
fe62f214fe
commit
752b9b0f6c
@ -153,9 +153,9 @@ bool gateway_is_ready(Link *link, bool onlink, int family, const union in_addr_u
|
|||||||
continue;
|
continue;
|
||||||
if (FLAGS_SET(a->flags, IFA_F_NOPREFIXROUTE))
|
if (FLAGS_SET(a->flags, IFA_F_NOPREFIXROUTE))
|
||||||
continue;
|
continue;
|
||||||
if (in_addr_is_set(a->family, &a->in_addr_peer))
|
if (in_addr_prefix_covers(a->family,
|
||||||
continue;
|
in_addr_is_set(a->family, &a->in_addr_peer) ? &a->in_addr_peer : &a->in_addr,
|
||||||
if (in_addr_prefix_covers(family, &a->in_addr, a->prefixlen, gw) > 0)
|
a->prefixlen, gw) > 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user