Commit 3fff06af authored by Beniamino Galvani's avatar Beniamino Galvani

ifcfg-rh: preserve existence of wired setting

Currently the plugin doesn't preserve the existence of a wired setting
because the writer saves only variables with non-default values and,
especially, the reader always creates the setting.

Fix this; now the writer writes HWADDR even if empty when the setting
is present; the reader creates the setting when at least one property
is found.
parent e43b1791
Pipeline #38758 passed with stages
in 42 minutes and 21 seconds
......@@ -714,6 +714,8 @@ _nm_g_slice_free_fcn_define (16)
* @NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY: the profile is currently not
* available/compatible with the device, but this may be only temporary.
*
* @NM_UTILS_ERROR_SETTING_MISSING: the setting is missing
*
* @NM_UTILS_ERROR_INVALID_ARGUMENT: invalid argument.
*/
typedef enum {
......@@ -736,6 +738,8 @@ typedef enum {
NM_UTILS_ERROR_CONNECTION_AVAILABLE_UNMANAGED_DEVICE,
NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
NM_UTILS_ERROR_SETTING_MISSING,
} NMUtilsError;
#define NM_UTILS_ERROR (nm_utils_error_quark ())
......
......@@ -1297,7 +1297,7 @@ write_wired_for_virtual (NMConnection *connection, shvarFile *ifcfg)
has_wired = TRUE;
device_mac = nm_setting_wired_get_mac_address (s_wired);
svSetValueStr (ifcfg, "HWADDR", device_mac);
svSetValue (ifcfg, "HWADDR", device_mac ?: "");
cloned_mac = nm_setting_wired_get_cloned_mac_address (s_wired);
svSetValueStr (ifcfg, "MACADDR", cloned_mac);
......
BONDING_OPTS="downdelay=5 miimon=100 mode=balance-rr updelay=10"
TYPE=Bond
BONDING_MASTER=yes
HWADDR=
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
......
......@@ -5,6 +5,7 @@ VLAN_ID=444
REORDER_HDR=yes
GVRP=no
MVRP=no
HWADDR=
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
......
......@@ -8,6 +8,7 @@ VLAN_FLAGS=LOOSE_BINDING
MVRP=no
VLAN_INGRESS_PRIORITY_MAP=0:1,2:5
VLAN_EGRESS_PRIORITY_MAP=3:1,12:3,14:7
HWADDR=
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
......
......@@ -4,6 +4,7 @@ VLAN_ID=142
REORDER_HDR=yes
GVRP=no
MVRP=no
HWADDR=
NAME=team-slave-enp31s0f1-142
UUID=74f435bb-ede4-415a-9d48-f580b60eba04
DEVICE=enp31s0f1-142
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment