]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: get rid of "Could not set flow control of" message on "lo" interface
authorLennart Poettering <lennart@poettering.net>
Tue, 12 May 2020 21:48:27 +0000 (23:48 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 May 2020 15:58:53 +0000 (17:58 +0200)
When setting flow control attributes of an interface we first acquire
the current settings and then add in the new settings before applying
them again. This only works on interfaces that implement the ethtool
ioctls. on others we'll see an ugly "Could not set flow control of"
message, simply because we issue the SIOCETHTOOL ioctl once, for getting
the data. In particular we'll get it for the "lo" interface all the
time, which sucks hard. Let's get rid of it.

src/udev/net/link-config.c

index e4ace761b72c22fab646d17b1e9a48f16207a702..07e7026549ec793e0727a9eb710132c78b9a8a6b 100644 (file)
@@ -413,9 +413,11 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
                         log_warning_errno(r, "Could not set ring buffer of %s: %m", old_name);
         }
 
-        r = ethtool_set_flow_control(&ctx->ethtool_fd, old_name, config->rx_flow_control, config->tx_flow_control, config->autoneg_flow_control);
-        if (r < 0)
-                log_warning_errno(r, "Could not set flow control of %s: %m", old_name);
+        if (config->rx_flow_control >= 0 || config->tx_flow_control >= 0 || config->autoneg_flow_control >= 0) {
+                r = ethtool_set_flow_control(&ctx->ethtool_fd, old_name, config->rx_flow_control, config->tx_flow_control, config->autoneg_flow_control);
+                if (r < 0)
+                        log_warning_errno(r, "Could not set flow control of %s: %m", old_name);
+        }
 
         r = sd_device_get_ifindex(device, &ifindex);
         if (r < 0)