mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 02:38:08 +02:00
libnm-core: validate the ipvlan mode
The setting must reject unknown ipvlan modes. Fixes:d238ff487b('ipvlan: add support to IPVLAN interface') (cherry picked from commitfdb8f07c44)
This commit is contained in:
parent
6b01ae3f15
commit
f78dca964f
1 changed files with 13 additions and 0 deletions
|
|
@ -156,6 +156,19 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!NM_IN_SET(priv->mode,
|
||||||
|
NM_SETTING_IPVLAN_MODE_L2,
|
||||||
|
NM_SETTING_IPVLAN_MODE_L3,
|
||||||
|
NM_SETTING_IPVLAN_MODE_L3S)) {
|
||||||
|
g_set_error(error,
|
||||||
|
NM_CONNECTION_ERROR,
|
||||||
|
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||||
|
_("unsupported mode %u"),
|
||||||
|
priv->mode);
|
||||||
|
g_prefix_error(error, "%s.%s: ", NM_SETTING_IPVLAN_SETTING_NAME, NM_SETTING_IPVLAN_MODE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->private_flag && priv->vepa) {
|
if (priv->private_flag && priv->vepa) {
|
||||||
g_set_error(error,
|
g_set_error(error,
|
||||||
NM_CONNECTION_ERROR,
|
NM_CONNECTION_ERROR,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue