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

This commit is contained in:
Yu Watanabe
2022-02-26 14:59:56 +09:00
parent a23e4f60d5
commit 490c00a369
+4 -1
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)