From 38246b18021cff44bb5cc2230c70523293a131e7 Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Fri, 14 May 2021 15:09:51 +0200 Subject: [PATCH] ifcfg: fix wired reader for ACCEPT_ALL_MAC_ADDRESSES key When the ACCEPT_ALL_MAC_ADDRESSES key is found by the wired reader, the wired setting was not being created. Fixes: d946aa0c503e ('wired-setting: add support to accept-all-mac-addresses') Signed-off-by: Fernando Fernandez Mancera --- .../settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 2a068b64d2..9bc4c9c46b 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -5022,6 +5022,7 @@ make_wired_setting(shvarFile *ifcfg, const char *file, NMSetting8021x **s_8021x, const char * cvalue; gs_free char * value = NULL; gboolean found = FALSE; + NMTernary accept_all_mac_addresses; s_wired = NM_SETTING_WIRED(nm_setting_wired_new()); @@ -5180,10 +5181,14 @@ make_wired_setting(shvarFile *ifcfg, const char *file, NMSetting8021x **s_8021x, } nm_clear_g_free(&value); - g_object_set(s_wired, - NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES, - svGetValueTernary(ifcfg, "ACCEPT_ALL_MAC_ADDRESSES"), - NULL); + accept_all_mac_addresses = svGetValueTernary(ifcfg, "ACCEPT_ALL_MAC_ADDRESSES"); + if (accept_all_mac_addresses != NM_TERNARY_DEFAULT) { + g_object_set(s_wired, + NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES, + accept_all_mac_addresses, + NULL); + found = TRUE; + } if (!found) { g_set_error(error,