mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 15:40:22 +01:00
libnm: reject infiniband.p-key set to 0, 0x8000
Kernel does not allow this ([1], [2]).
Usually tightening the verification is a break of API. But in this case,
no user had a working configuration that is breaking. At worst, they
had a broken profile that no longer loads.
We also filter those from _infiniband_add_add_or_delete(), since [3].
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/infiniband/ulp/ipoib/ipoib_main.c?id=f443e374ae131c168a065ea1748feac6b2e76613#n2394
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/infiniband/ulp/ipoib/ipoib_vlan.c?id=f443e374ae131c168a065ea1748feac6b2e76613#n116
[3] eab817d34a
This commit is contained in:
parent
fd5945b408
commit
7012b9001a
1 changed files with 8 additions and 0 deletions
|
|
@ -241,6 +241,14 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
g_prefix_error(error, "%s: ", NM_SETTING_INFINIBAND_PARENT);
|
||||
return FALSE;
|
||||
}
|
||||
if (NM_IN_SET(priv->p_key, 0, 0x8000)) {
|
||||
g_set_error_literal(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("the values 0 and 0x8000 are not allowed"));
|
||||
g_prefix_error(error, "%s: ", NM_SETTING_INFINIBAND_P_KEY);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (connection)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue