core: prevent multiple attempts to create default wired connection

System Internals / NetworkManager - Thomas Haller [redhat.com] - 28 March 2020 10:01 EDT

Scenario:

- have ethernet connection as unmanaged.
- create (or have) a suitable profile for the connection.- make the device as managed. No default wired connection gets created.
- delete the profile.

Note that NMManager does in manager_device_state_changed():

»···if (NM_IN_SET (new_state, »··· NM_DEVICE_STATE_UNAVAILABLE, »··· NM_DEVICE_STATE_DISCONNECTED)) »···»···nm_settings_device_added (priv->settings, device);

that means, when the device the next time goes through UNAVAILABLE/DISCONNECTED states, we will suddenly create the default "Wired connection 1" profile.

That doesn't seem right. When a device is suitable to have a default-wired connection, we should only check once whether to create it. We should not retry that later. The !no-auto-default mechanism exists so we can start NetworkManager without a profile for the device. It doesn't mean that we later one (after previously deciding not to create a profile), we still create it.

https://bugzilla.redhat.com/show_bug.cgi?id=1687937

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/450

ff814923e core: prevent multiple attempts to create default wired connection
src/settings/nm-settings.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share