From 09a3f3bee6709221d20b5c94f946b7131ad9aea6 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 15 Nov 2019 22:09:14 +0100 Subject: manager: assume DHCP if we see a lease on taking over an initramfs connection In general, we aren't really able to tell, but when we see a lease file we're pretty sure that DHCP is what was going on. https://bugzilla.redhat.com/show_bug.cgi?id=1771792 Fixes: f2fe6c03ee3f ('manager: don't treat the initramfs-configured DHCP connections as generated') --- src/nm-manager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index e9fd134e2c..aff7f587e2 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2727,6 +2727,12 @@ recheck_assume_connection (NMManager *self, activation_type_assume = TRUE; if (generated) { + /* Reset the IPv4 setting to empty method=auto, regardless of what assumption guessed. */ + nm_connection_add_setting (nm_settings_connection_get_connection (sett_conn), + g_object_new (NM_TYPE_SETTING_IP4_CONFIG, + NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL)); + nm_settings_connection_update (sett_conn, NULL, NM_SETTINGS_CONNECTION_PERSIST_MODE_KEEP, -- cgit v1.2.1