chiark / gitweb /
networkd: link - always maintain link operstate regardless of admin state
authorTom Gundersen <teg@jklm.no>
Wed, 7 May 2014 14:42:47 +0000 (16:42 +0200)
committerTom Gundersen <teg@jklm.no>
Wed, 7 May 2014 14:54:02 +0000 (16:54 +0200)
src/network/networkd-link.c

index 2f99b53..0f2004d 100644 (file)
@@ -1139,9 +1139,6 @@ static int link_update_flags(Link *link, sd_rtnl_message *m) {
 
         assert(link);
 
-        if (link->state == LINK_STATE_FAILED)
-                return 0;
-
         r = sd_rtnl_message_link_get_flags(m, &flags);
         if (r < 0) {
                 log_warning_link(link, "Could not get link flags");
@@ -1232,6 +1229,10 @@ static int link_update_flags(Link *link, sd_rtnl_message *m) {
 
         link_save(link);
 
+        if (link->state == LINK_STATE_FAILED ||
+            link->state == LINK_STATE_UNMANAGED)
+                return 0;
+
         if (carrier_gained) {
                 log_info_link(link, "gained carrier");
 
@@ -1621,9 +1622,6 @@ int link_update(Link *link, sd_rtnl_message *m) {
         assert(link->ifname);
         assert(m);
 
-        if (link->state == LINK_STATE_FAILED || link->state == LINK_STATE_UNMANAGED)
-                return 0;
-
         r = sd_rtnl_message_read_string(m, IFLA_IFNAME, &ifname);
         if (r >= 0 && !streq(ifname, link->ifname)) {
                 log_info_link(link, "renamed to %s", ifname);