libnm-core: fix p-key validation for Infiniband connections

verify() is setting an error without returning FALSE to make the
validation fail. When the parent is set, the device is a Infiniband
partition and it must have a p-key != -1.

Fixes: d595f7843e ('libnm: add libnm/libnm-core (part 1)')
(cherry picked from commit f4f1ecc7ea)
This commit is contained in:
Beniamino Galvani 2025-07-07 09:15:01 +02:00 committed by Íñigo Huguet
parent 976c5dbb5f
commit 6b01ae3f15

View file

@ -212,6 +212,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("Must specify a P_Key if specifying parent"));
g_prefix_error(error, "%s: ", NM_SETTING_INFINIBAND_PARENT);
return FALSE;
}
}