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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user