system-settings: allow glob (*) in no-auto-default config file option

When * is used instead of MAC addresses' list, no-auto-default option
is valid for all interfaces.
This commit is contained in:
Pat Suwalski 2010-09-27 11:08:03 +02:00 committed by Jiří Klimeš
parent facf6b176f
commit db3f91deae

View file

@ -1078,6 +1078,11 @@ is_mac_auto_wired_blacklisted (NMSysconfigSettings *self, const GByteArray *mac)
for (iter = list; iter && *iter; iter++) {
struct ether_addr *candidate;
if (strcmp(g_strstrip(*iter), "*") == 0) {
found = TRUE;
break;
}
candidate = ether_aton (*iter);
if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN)) {
found = TRUE;
@ -1137,13 +1142,19 @@ default_wired_deleted (NMDefaultWiredConnection *wired,
g_key_file_load_from_file (config, priv->config_file, G_KEY_FILE_KEEP_COMMENTS, NULL);
list = g_key_file_get_string_list (config, "main", CONFIG_KEY_NO_AUTO_DEFAULT, &len, NULL);
/* Traverse entire list to get count of # items */
for (iter = list; iter && *iter; iter++) {
struct ether_addr *candidate;
candidate = ether_aton (*iter);
if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN))
if (strcmp(g_strstrip(*iter), "*") == 0) {
found = TRUE;
break;
}
candidate = ether_aton (*iter);
if (candidate && !memcmp (mac->data, candidate->ether_addr_octet, ETH_ALEN)) {
found = TRUE;
break;
}
}
/* Add this device's MAC to the list */