summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-address.c6
-rw-r--r--src/network/networkd-address.h1
-rw-r--r--src/network/networkd-link.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 48715972b6..316ae2e4cb 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -738,3 +738,9 @@ int config_parse_label(const char *unit,
return 0;
}
+
+bool address_is_ready(const Address *a) {
+ assert(a);
+
+ return !(a->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED));
+}
diff --git a/src/network/networkd-address.h b/src/network/networkd-address.h
index 22ac5e95c1..425344fe48 100644
--- a/src/network/networkd-address.h
+++ b/src/network/networkd-address.h
@@ -67,6 +67,7 @@ int address_configure(Address *address, Link *link, sd_netlink_message_handler_t
int address_update(Address *address, Link *link, sd_netlink_message_handler_t callback);
int address_remove(Address *address, Link *link, sd_netlink_message_handler_t callback);
bool address_equal(Address *a1, Address *a2);
+bool address_is_ready(const Address *a);
DEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
#define _cleanup_address_free_ _cleanup_(address_freep)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 78853c8cca..755d9c919d 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2275,7 +2275,7 @@ static void link_update_operstate(Link *link) {
/* if we have carrier, check what addresses we have */
SET_FOREACH(address, link->addresses, i) {
- if (address->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED))
+ if (!address_is_ready(address))
continue;
if (address->scope < scope)