NetworkManager/src/settings/plugins/ifcfg-rh
Beniamino Galvani fb191fc282 ifcfg-rh: use distinct variables for bridge and wired mac address
Currently both bridge.mac-address and ethernet.cloned-mac-address get
written to the same MACADDR ifcfg-rh variable; the ethernet property
wins if both are present.

When one property is set and the connection is saved (and thus reread)
both properties are populated with the same value. This is wrong
because, even if the properties have the same meaning, the setting
plugin should not read something different from what was written. Also
consider that after the following steps:

 $ nmcli con mod c ethernet.cloned-mac-address 00:11:22:33:44:55
 $ nmcli con mod c ethernet.cloned-mac-address ""

the connection will still have the new mac address set in the
bridge.mac-address property, which is certainly unexpected.

In general, mapping multiple properties to the same variable is
harmful and must be avoided. Therefore, let's use a different variable
for bridge.mac-address. This changes behavior, but not so much:

 - connections that have MACADDR set will behave as before; the only
   difference will be that the MAC will be present in the wired
   setting instead of the bridge one;

 - initscripts compatibility is not relevant because MACADDR for
   bridges was a NM extension;

 - if someone creates a new connection and sets bridge.mac-address NM
   will set the BRIDGE_MACADDR property instead of MACADDR. But this
   shouldn't be a big concern as bridge.mac-address is documented as
   deprecated and should not be used for new connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1516659
2017-11-23 18:43:48 +01:00
..
tests ifcfg-rh: use distinct variables for bridge and wired mac address 2017-11-23 18:43:48 +01:00
nm-ifcfg-rh.conf ifcfg-rh: refactor dbus policy 2017-06-15 13:20:55 +02:00
nm-ifcfg-rh.xml dbus: fix up the XML formatting 2016-04-05 14:37:51 +02:00
nms-ifcfg-rh-common.h ifcfg-rh: rename files 2016-10-11 11:37:46 +02:00
nms-ifcfg-rh-connection.c settings: drop redundant can_commit() virtual functions 2017-10-25 14:04:36 +02:00
nms-ifcfg-rh-connection.h build: don't add subdirectories to include search path but require qualified include 2016-11-21 14:26:37 +01:00
nms-ifcfg-rh-plugin.c all: use nm_direct_hash() instead of g_direct_hash() 2017-11-16 11:49:52 +01:00
nms-ifcfg-rh-plugin.h ifcfg-rh: rename files 2016-10-11 11:37:46 +02:00
nms-ifcfg-rh-reader.c ifcfg-rh: use distinct variables for bridge and wired mac address 2017-11-23 18:43:48 +01:00
nms-ifcfg-rh-reader.h ifcfg-rh/tests: rename test function connection_from_file_test() 2017-10-25 14:04:36 +02:00
nms-ifcfg-rh-utils.c ifcfg-rh: split function to write connection to disk 2017-10-27 10:28:41 +02:00
nms-ifcfg-rh-utils.h ifcfg-rh: don't let complex routes (rule files) prevent writing connection 2017-10-25 14:04:36 +02:00
nms-ifcfg-rh-writer.c ifcfg-rh: use distinct variables for bridge and wired mac address 2017-11-23 18:43:48 +01:00
nms-ifcfg-rh-writer.h ifcfg-rh: merge new_connection() and update_connection() functions 2017-10-25 14:04:36 +02:00
shvar.c ifcfg-rh: replace svUnsetValuesWithPrefix() by svUnsetAll(USER) 2017-10-25 14:04:36 +02:00
shvar.h ifcfg-rh: replace svUnsetValuesWithPrefix() by svUnsetAll(USER) 2017-10-25 14:04:36 +02:00