mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
libnm-core: fix verify() implementations to allow connection=NULL
This commit is contained in:
parent
0d71c0569f
commit
c22672b383
|
@ -1787,6 +1787,9 @@ _nm_connection_verify_required_interface_name (NMConnection *connection,
|
|||
{
|
||||
const char *interface_name;
|
||||
|
||||
if (!connection)
|
||||
return TRUE;
|
||||
|
||||
interface_name = nm_connection_get_interface_name (connection);
|
||||
if (interface_name)
|
||||
return TRUE;
|
||||
|
|
|
@ -645,7 +645,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
}
|
||||
}
|
||||
|
||||
if (nm_connection_get_setting_infiniband (connection)) {
|
||||
if (connection && nm_connection_get_setting_infiniband (connection)) {
|
||||
if (strcmp (mode_new, "active-backup") != 0) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
|
|
|
@ -181,7 +181,7 @@ nm_setting_infiniband_get_virtual_interface_name (NMSettingInfiniband *setting)
|
|||
static gboolean
|
||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
NMSettingConnection *s_con = NULL;
|
||||
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE (setting);
|
||||
guint32 normerr_max_mtu = 0;
|
||||
|
||||
|
@ -241,7 +241,8 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
|
|||
}
|
||||
}
|
||||
|
||||
s_con = nm_connection_get_setting_connection (connection);
|
||||
if (connection)
|
||||
s_con = nm_connection_get_setting_connection (connection);
|
||||
if (s_con) {
|
||||
const char *interface_name = nm_setting_connection_get_interface_name (s_con);
|
||||
GError *tmp_error = NULL;
|
||||
|
|
Loading…
Reference in a new issue