mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 21:20:10 +01:00
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:
parent
facf6b176f
commit
db3f91deae
1 changed files with 14 additions and 3 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue