mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 13:38:43 +02:00
shared: reject reserved names from "connection.interface-name"
"all" and "default" never works. "bonding_masters" works if you unload the bonding module. Well, that should not really be called working... Reject these names.
This commit is contained in:
parent
ef567805bb
commit
d4d9e9e7bb
1 changed files with 13 additions and 0 deletions
|
|
@ -4149,6 +4149,19 @@ _nm_utils_ifname_valid_kernel (const char *name, GError **error)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NM_IN_STRSET (name, "all",
|
||||||
|
"default",
|
||||||
|
"bonding_masters")) {
|
||||||
|
/* Certain names are not allowed. The "all" and "default" names are reserved
|
||||||
|
* due to their directories in "/proc/sys/net/ipv4/conf/" and "/proc/sys/net/ipv6/conf/".
|
||||||
|
*
|
||||||
|
* Also, there is "/sys/class/net/bonding_masters" file.
|
||||||
|
*/
|
||||||
|
nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN,
|
||||||
|
_("'%s' is not allowed as interface name"), name);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue