]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: do not silently stop to process configuration on activation failure
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Jul 2022 21:04:51 +0000 (06:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 22 Jul 2022 23:11:36 +0000 (08:11 +0900)
Previously, if activation failed, link did not enter the failed state,
but still Link.activated flag not set. Hence, nothing processed even if
the interface is manually brought up later.

Partially fixes #23649.

src/network/networkd-setlink.c

index 148277685e0355e693e4e0477ef244fe58b1c2de..97c68487172a930a78af5a46bbf43e139b94cd50 100644 (file)
@@ -951,17 +951,10 @@ static int link_up_or_down_handler(sd_netlink *rtnl, sd_netlink_message *m, Requ
         r = sd_netlink_message_get_errno(m);
         if (r == -ENETDOWN && up && link_up_dsa_slave(link) > 0)
                 log_link_message_debug_errno(link, m, r, "Could not bring up dsa slave, retrying again after dsa master becomes up");
-        else if (r < 0) {
-                const char *error_msg;
-
-                error_msg = up ?
-                        (on_activate ? "Could not bring up interface" : "Could not bring up interface, ignoring") :
-                        (on_activate ? "Could not bring down interface" : "Could not bring down interface, ignoring");
-
-                log_link_message_warning_errno(link, m, r, error_msg);
-                if (on_activate)
-                        return 0;
-        }
+        else if (r < 0)
+                log_link_message_warning_errno(link, m, r, up ?
+                                               "Could not bring up interface, ignoring" :
+                                               "Could not bring down interface, ignoring");
 
         r = link_call_getlink(link, get_link_update_flag_handler);
         if (r < 0) {