summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-11-15 22:09:14 +0100
committerLubomir Rintel <lkundrak@v3.sk>2019-11-15 22:09:14 +0100
commit09a3f3bee6709221d20b5c94f946b7131ad9aea6 (patch)
treec99c1e25314c426cd1bd64e748c25d20a37ff4b4
parent3165fd8e8eb5ccbc2647b6104ab475f1c5e14178 (diff)
downloadNetworkManager-lr/initramfs-takeover.tar.gz
manager: assume DHCP if we see a lease on taking over an initramfs connectionlr/initramfs-takeover
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')
-rw-r--r--src/nm-manager.c6
1 files changed, 6 insertions, 0 deletions
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,