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 78b3711522)
This commit is contained in:
Thomas Haller 2021-08-30 14:48:53 +02:00
parent e2fe64a3d8
commit ef76937e67
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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 {