mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 20:40:21 +01:00
ifcfg-rh: use nm_utils_ifname_valid() for validating interface-name in reader
Maybe the reader should not try to add its own validation. It could just read the value, set it in the profile, and let nm_connection_verify() handle it. However: - in this form the code only logs a warning about invalid setting. If we let it come to nm_connection_verify(), the connection profile will be entirely rejected. I think this makes sense, because ifcfg files may be edited by the user and we don't know what is out there. - it's nicer to show a warning that specifically mentions the DEVICE= variable. There error message we get from nm_connection_verify() is no longer aware of ifcfg peculiarities. Instead: use the appropriate validation function.
This commit is contained in:
parent
de19631e9f
commit
aa6bc2868d
1 changed files with 3 additions and 1 deletions
|
|
@ -399,7 +399,9 @@ make_connection_setting (const char *file,
|
|||
if (v) {
|
||||
GError *error = NULL;
|
||||
|
||||
if (nm_utils_ifname_valid_kernel (v, &error)) {
|
||||
/* Only validate for NMU_IFACE_KERNEL, because ifcfg plugin anyway
|
||||
* doesn't support OVS types. */
|
||||
if (nm_utils_ifname_valid (v, NMU_IFACE_KERNEL, &error)) {
|
||||
g_object_set (s_con,
|
||||
NM_SETTING_CONNECTION_INTERFACE_NAME, v,
|
||||
NULL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue