1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-03 17:47:28 +03:00

network: netdev: make link_get_local_address() refuse non-ready links and addresses

This commit is contained in:
Yu Watanabe 2022-02-25 13:20:59 +09:00
parent a23e4f60d5
commit 490c00a369

View File

@ -51,8 +51,11 @@ int link_get_local_address(
assert_not_reached();
}
if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
return -EBUSY;
SET_FOREACH(a, link->addresses) {
if (!address_exists(a))
if (!address_is_ready(a))
continue;
if (a->family != family)