chiark / gitweb /
networkd-wait-online: add missing short option 'i' to optstring
[elogind.git] / src / network / networkd-link.c
index 248022133f475a00bc65a66d749f32aee708cf6e..dff3270f2a5a6b92f1c99a0cd4f32f38bd6a4ef9 100644 (file)
@@ -1052,7 +1052,6 @@ static int link_joined(Link *link) {
         int r;
 
         assert(link);
-        assert(link->state == LINK_STATE_ENSLAVING);
         assert(link->network);
 
         if (!(link->flags & IFF_UP)) {
@@ -1072,8 +1071,6 @@ static int netdev_join_handler(sd_rtnl *rtnl, sd_rtnl_message *m,
         int r;
 
         assert(link);
-        assert(IN_SET(link->state, LINK_STATE_ENSLAVING, LINK_STATE_FAILED,
-                      LINK_STATE_LINGER));
         assert(link->network);
 
         link->enslaving --;
@@ -1389,6 +1386,13 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message,
                 return 0;
         }
 
+        r = sd_rtnl_message_addr_get_flags(message, &address->flags);
+        if (r < 0) {
+                log_warning_link(link,
+                                 "rtnl: received address with invalid flags, ignoring");
+                return 0;
+        }
+
         switch (address->family) {
         case AF_INET:
                 r = sd_rtnl_message_read_in_addr(message, IFA_LOCAL,
@@ -1661,6 +1665,9 @@ static void link_update_operstate(Link *link) {
 
                 /* if we have carrier, check what addresses we have */
                 LIST_FOREACH(addresses, address, link->addresses) {
+                        if (address->flags & (IFA_F_TENTATIVE | IFA_F_DEPRECATED))
+                                continue;
+
                         if (address->scope < scope)
                                 scope = address->scope;
                 }