1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 23:21:22 +03:00

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.
This commit is contained in:
Yu Watanabe 2021-12-06 00:29:39 +09:00
parent b489d6a26e
commit cf477495d6

View File

@ -116,7 +116,7 @@ static bool link_address_is_reachable(Link *link, int family, const union in_add
continue; continue;
if (route->family != family) if (route->family != family)
continue; continue;
if (!in_addr_is_set(route->family, &route->dst)) if (!in_addr_is_set(route->family, &route->dst) && route->dst_prefixlen == 0)
continue; continue;
if (in_addr_prefix_covers(family, &route->dst, route->dst_prefixlen, address) > 0) if (in_addr_prefix_covers(family, &route->dst, route->dst_prefixlen, address) > 0)
return true; return true;