From: Lennart Poettering Date: Tue, 12 May 2020 21:48:27 +0000 (+0200) Subject: udev: get rid of "Could not set flow control of" message on "lo" interface X-Git-Tag: v246-rc1~357 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb1277fa3b1d7a5b6e1b7cce31b91cd2efdad97a;p=thirdparty%2Fsystemd.git udev: get rid of "Could not set flow control of" message on "lo" interface 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. --- diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index e4ace761b72..07e7026549e 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -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)