summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-link.c')
-rw-r--r--src/network/networkd-link.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 1ac76c4255..c0f27aaca8 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -297,6 +297,11 @@ static void link_free(Link *link) {
set_free(link->addresses);
+ while (!set_isempty(link->addresses_foreign))
+ address_free(set_first(link->addresses_foreign));
+
+ set_free(link->addresses_foreign);
+
while ((address = link->pool_addresses)) {
LIST_REMOVE(addresses, link->pool_addresses, address);
address_free(address);
@@ -508,7 +513,9 @@ void link_check_ready(Link *link) {
Iterator i;
assert(link);
- assert(link->network);
+
+ if (!link->network)
+ return;
if (!link->static_configured)
return;
@@ -2324,6 +2331,15 @@ static void link_update_operstate(Link *link) {
scope = address->scope;
}
+ /* for operstate we also take foreign addresses into account */
+ SET_FOREACH(address, link->addresses_foreign, i) {
+ if (!address_is_ready(address))
+ continue;
+
+ if (address->scope < scope)
+ scope = address->scope;
+ }
+
if (scope < RT_SCOPE_SITE)
/* universally accessible addresses found */
operstate = LINK_OPERSTATE_ROUTABLE;