Blob Blame History Raw
From 14dc1e18cf8a7595ca4d4b04203fc8ff7f0a29ca Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Fri, 24 Feb 2017 20:25:56 +0100
Subject: [PATCH 1/1] Revert "device: change default value for
 cloned-mac-address to "preserve" (bgo#770611)"

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

This reverts commit fae5ecec5a4d9987a1915441602cb78275a9f490.
---
 libnm-core/nm-setting-wired.c    | 7 +++----
 libnm-core/nm-setting-wireless.c | 7 +++----
 man/NetworkManager.conf.xml      | 4 ++--
 src/devices/nm-device.c          | 3 ++-
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c
index 5569f55..9bf8255 100644
--- a/libnm-core/nm-setting-wired.c
+++ b/libnm-core/nm-setting-wired.c
@@ -1144,8 +1144,8 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_wired_class)
 	/**
 	 * NMSettingWired:cloned-mac-address:
 	 *
-	 * If specified, request that the device use this MAC address instead.
-	 * This is known as MAC cloning or spoofing.
+	 * If specified, request that the device use this MAC address instead of its
+	 * permanent MAC address.  This is known as MAC cloning or spoofing.
 	 *
 	 * Beside explicitly specifing a MAC address, the special values "preserve", "permanent",
 	 * "random" and "stable" are supported.
@@ -1156,8 +1156,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_wired_class)
 	 * machine dependent key.
 	 *
 	 * If unspecified, the value can be overwritten via global defaults, see manual
-	 * of NetworkManager.conf. If still unspecified, it defaults to "preserve"
-	 * (older versions of NetworkManager may use a different default value).
+	 * of NetworkManager.conf. If still unspecified, it defaults to "permanent".
 	 *
 	 * On D-Bus, this field is expressed as "assigned-mac-address" or the deprecated
 	 * "cloned-mac-address".
diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c
index 8ae84d4..316e812 100644
--- a/libnm-core/nm-setting-wireless.c
+++ b/libnm-core/nm-setting-wireless.c
@@ -1350,8 +1350,8 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_wireless_class)
 	/**
 	 * NMSettingWireless:cloned-mac-address:
 	 *
-	 * If specified, request that the device use this MAC address instead.
-	 * This is known as MAC cloning or spoofing.
+	 * If specified, request that the device use this MAC address instead of its
+	 * permanent MAC address.  This is known as MAC cloning or spoofing.
 	 *
 	 * Beside explicitly specifing a MAC address, the special values "preserve", "permanent",
 	 * "random" and "stable" are supported.
@@ -1362,8 +1362,7 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_wireless_class)
 	 * machine dependent key.
 	 *
 	 * If unspecified, the value can be overwritten via global defaults, see manual
-	 * of NetworkManager.conf. If still unspecified, it defaults to "preserve"
-	 * (older versions of NetworkManager may use a different default value).
+	 * of NetworkManager.conf. If still unspecified, it defaults to "permanent".
 	 *
 	 * On D-Bus, this field is expressed as "assigned-mac-address" or the deprecated
 	 * "cloned-mac-address".
diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml
index 658fd7c..2a8ba76 100644
--- a/man/NetworkManager.conf.xml
+++ b/man/NetworkManager.conf.xml
@@ -635,7 +635,7 @@ ipv6.ip6-privacy=0
         </varlistentry>
         <varlistentry>
           <term><varname>ethernet.cloned-mac-address</varname></term>
-          <listitem><para>If left unspecified, it defaults to "preserve".</para></listitem>
+          <listitem><para>If left unspecified, it defaults to "permanent".</para></listitem>
         </varlistentry>
         <varlistentry>
           <term><varname>ethernet.generate-mac-address-mask</varname></term>
@@ -681,7 +681,7 @@ ipv6.ip6-privacy=0
         </varlistentry>
         <varlistentry>
           <term><varname>wifi.cloned-mac-address</varname></term>
-          <listitem><para>If left unspecified, it defaults to "preserve".</para></listitem>
+          <listitem><para>If left unspecified, it defaults to "permanent".</para></listitem>
         </varlistentry>
         <varlistentry>
           <term><varname>wifi.generate-mac-address-mask</varname></term>
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index da581a0..9c30790 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -13059,7 +13059,8 @@ _get_cloned_mac_address_setting (NMDevice *self, NMConnection *connection, gbool
 		                                           is_wifi ? "wifi.cloned-mac-address" : "ethernet.cloned-mac-address",
 		                                           self);
 
-		addr = NM_CLONED_MAC_PRESERVE;
+		/* RHEL patches the default to permanent (rh#1413312) */
+		addr = NM_CLONED_MAC_PERMANENT;
 
 		if (!a) {
 			if (is_wifi) {
-- 
2.9.3