1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

network: rework route_scope_from_address()

This commit is contained in:
Yu Watanabe 2019-07-06 11:17:48 +09:00
parent 9a897e22d4
commit 7ed5420ab2

View File

@ -75,8 +75,8 @@ static int route_scope_from_address(const Route *route, const struct in_addr *se
assert(route);
assert(self_addr);
if (in_addr_is_localhost(AF_INET, &route->dst) ||
(self_addr->s_addr && route->dst.in.s_addr == self_addr->s_addr))
if (in4_addr_is_localhost(&route->dst.in) ||
(!in4_addr_is_null(self_addr) && in4_addr_equal(&route->dst.in, self_addr)))
return RT_SCOPE_HOST;
else if (in4_addr_is_null(&route->gw.in))
return RT_SCOPE_LINK;