diff --git a/libnm-core/nm-connection-private.h b/libnm-core/nm-connection-private.h index 90d91439bc..3c505834b4 100644 --- a/libnm-core/nm-connection-private.h +++ b/libnm-core/nm-connection-private.h @@ -28,7 +28,7 @@ int _nm_setting_ovs_interface_verify_interface_type (NMSettingOvsInterface *self NMConnection *connection, gboolean normalize, gboolean *out_modified, - const char **normalized_type, + const char **out_normalized_type, GError **error); #endif /* __NM_CONNECTION_PRIVATE_H__ */ diff --git a/libnm-core/nm-setting-ovs-interface.c b/libnm-core/nm-setting-ovs-interface.c index 85e77b5443..114e0205d3 100644 --- a/libnm-core/nm-setting-ovs-interface.c +++ b/libnm-core/nm-setting-ovs-interface.c @@ -68,7 +68,7 @@ _nm_setting_ovs_interface_verify_interface_type (NMSettingOvsInterface *self, NMConnection *connection, gboolean normalize, gboolean *out_modified, - const char **normalized_type, + const char **out_normalized_type, GError **error) { const char *type_from_setting = NULL; @@ -85,9 +85,8 @@ _nm_setting_ovs_interface_verify_interface_type (NMSettingOvsInterface *self, g_return_val_if_fail (!connection || NM_IS_CONNECTION (connection), FALSE); } - g_return_val_if_fail (!normalized_type || !(*normalized_type), FALSE); - NM_SET_OUT (out_modified, FALSE); + NM_SET_OUT (out_normalized_type, NULL); if ( type && !NM_IN_STRSET (type, "internal", "system", "patch", "dpdk")) { @@ -100,8 +99,10 @@ _nm_setting_ovs_interface_verify_interface_type (NMSettingOvsInterface *self, return FALSE; } - if (!connection) + if (!connection) { + NM_SET_OUT (out_normalized_type, type); return TRUE; + } connection_type = nm_connection_get_connection_type (connection); if (!connection_type) { @@ -192,6 +193,7 @@ _nm_setting_ovs_interface_verify_interface_type (NMSettingOvsInterface *self, g_prefix_error (error, "%s.%s: ", NM_SETTING_OVS_INTERFACE_SETTING_NAME, NM_SETTING_OVS_INTERFACE_TYPE); return FALSE; } + NM_SET_OUT (out_normalized_type, type); return TRUE; } type = type_from_setting; @@ -208,16 +210,17 @@ _nm_setting_ovs_interface_verify_interface_type (NMSettingOvsInterface *self, } } - if (type) + if (type) { + NM_SET_OUT (out_normalized_type, type); return TRUE; + } if (is_ovs_connection_type) type = "internal"; else type = "system"; - if (normalized_type) - *normalized_type = type; + NM_SET_OUT (out_normalized_type, type); normalize: if (!normalize) { @@ -309,8 +312,6 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) gs_free_error GError *ifname_error = NULL; const char *ifname = nm_setting_connection_get_interface_name (s_con); - normalized_type = self->type ? self->type : normalized_type; - if ( ifname && !nm_streq0 (normalized_type, "patch") && !nm_utils_ifname_valid (ifname,