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: d946aa0c50 ('wired-setting: add support to accept-all-mac-addresses')
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
This commit is contained in:
Fernando Fernandez Mancera 2021-05-14 15:09:51 +02:00 committed by Beniamino Galvani
parent a7cf9046d3
commit 38246b1802

View file

@ -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,