diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-05 16:29:39 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-12-06 11:16:17 +0100 |
commit | cf477495d6778f96677c15c8a8e49147d6d742cd (patch) | |
tree | c5afa5c8d9ae37931b9572fa60425c47a2a68f68 /src/network/networkd-route-util.c | |
parent | network: route: logs null address with non-zero prefixlen correctly (diff) | |
download | systemd-cf477495d6778f96677c15c8a8e49147d6d742cd.tar.xz systemd-cf477495d6778f96677c15c8a8e49147d6d742cd.zip |
network: route: handle null address with non-zero prefixlen correctly
Previously, even if a link has a route to e.g. ::/96, default gateway
via ::1.2.3.4 cannot be configured.
Diffstat (limited to 'src/network/networkd-route-util.c')
-rw-r--r-- | src/network/networkd-route-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/networkd-route-util.c b/src/network/networkd-route-util.c index c57adbe0ab..f5b502f464 100644 --- a/src/network/networkd-route-util.c +++ b/src/network/networkd-route-util.c @@ -116,7 +116,7 @@ static bool link_address_is_reachable(Link *link, int family, const union in_add continue; if (route->family != family) continue; - if (!in_addr_is_set(route->family, &route->dst)) + if (!in_addr_is_set(route->family, &route->dst) && route->dst_prefixlen == 0) continue; if (in_addr_prefix_covers(family, &route->dst, route->dst_prefixlen, address) > 0) return true; |