From ef76937e679aebf8345d34dcd32840b2ae63cdf4 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 30 Aug 2021 14:48:53 +0200 Subject: [PATCH] core: always reset ethtool autoneg/speed to fix reactivation The check whether the current setting are already as expected are wrong. The reason is that nm_platform_ethtool_set_link_settings() also sets the announced ethernet modes, but nm_platform_ethtool_get_link_settings() does not give them. That means, we cannot check whether the current link configuration is the same, because the getter doesn't give that information. Consequently, we must not skip the setting on the assumption that there is nothing to change. This bug has bad effects. If the device is currently activated with ethtool option set, then re-activating the profile will result in wrongly skipping the update. (cherry picked from commit 78b3711522317a4b56def1d0b50b7c98ef1d2e91) --- src/core/devices/nm-device-ethernet.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/core/devices/nm-device-ethernet.c b/src/core/devices/nm-device-ethernet.c index e160dd8a1a..95336c7a52 100644 --- a/src/core/devices/nm-device-ethernet.c +++ b/src/core/devices/nm-device-ethernet.c @@ -923,12 +923,6 @@ link_negotiation_set(NMDevice *device) return; } - /* If link negotiation setting are already in place do nothing and return with success */ - if (!!autoneg == !!link_autoneg && speed == link_speed && duplex == link_duplex) { - _LOGD(LOGD_DEVICE, "set-link: link negotiation is already configured"); - return; - } - if (autoneg && !speed && !duplex) _LOGD(LOGD_DEVICE, "set-link: configure auto-negotiation"); else {