config: move some spec-match-list handling from config to core
NMConfig accepted no-auto-default and ignore-carrier lists with untagged specs (ie, interface names not prefixed with "interface-name:" and hardware addresses not prefixed with "mac:"). Move that handling into nm_match_spec_interface_name() and nm_match_spec_hwaddr() instead.
This commit is contained in:
@@ -589,6 +589,9 @@ nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr)
|
||||
|
||||
g_return_val_if_fail (hwaddr != NULL, FALSE);
|
||||
|
||||
if (nm_match_spec_string (specs, hwaddr))
|
||||
return TRUE;
|
||||
|
||||
hwaddr_match = g_strdup_printf ("mac:%s", hwaddr);
|
||||
matched = nm_match_spec_string (specs, hwaddr_match);
|
||||
g_free (hwaddr_match);
|
||||
@@ -603,6 +606,9 @@ nm_match_spec_interface_name (const GSList *specs, const char *interface_name)
|
||||
|
||||
g_return_val_if_fail (interface_name != NULL, FALSE);
|
||||
|
||||
if (nm_match_spec_string (specs, interface_name))
|
||||
return TRUE;
|
||||
|
||||
iface_match = g_strdup_printf ("interface-name:%s", interface_name);
|
||||
matched = nm_match_spec_string (specs, iface_match);
|
||||
g_free (iface_match);
|
||||
|
Reference in New Issue
Block a user