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:
Dan Winship
2014-07-17 16:09:42 -04:00
parent 4308a8305a
commit 2b2faf9c28
4 changed files with 12 additions and 27 deletions

View File

@@ -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);