iface-modem-3gpp-profile-manager: fix requested IP type normalization

mm_iface_modem_3gpp_profile_manager_set_profile() was changed so that
the input profile object was not touched, and instead a copy of the
same would be used within the method.

Unfortunately, that change missed the update of the IP type
normalization step, which would end up modifying the original settings
instead of the newly created copy.

Fixes 7464940971
This commit is contained in:
Aleksander Morgado
2022-09-26 08:49:47 +00:00
parent 7b0b3e7e48
commit 4a36f50de8

View File

@@ -699,8 +699,8 @@ mm_iface_modem_3gpp_profile_manager_set_profile (MMIfaceModem3gppProfileManager
ctx->requested = g_object_ref (requested_copy); ctx->requested = g_object_ref (requested_copy);
ctx->index_field = g_strdup (index_field); ctx->index_field = g_strdup (index_field);
ctx->strict = strict; ctx->strict = strict;
ctx->profile_id = mm_3gpp_profile_get_profile_id (requested); ctx->profile_id = mm_3gpp_profile_get_profile_id (ctx->requested);
ctx->apn_type = mm_3gpp_profile_get_apn_type (requested); ctx->apn_type = mm_3gpp_profile_get_apn_type (ctx->requested);
ctx->apn_type_str = mm_bearer_apn_type_build_string_from_mask (ctx->apn_type); ctx->apn_type_str = mm_bearer_apn_type_build_string_from_mask (ctx->apn_type);
g_task_set_task_data (task, ctx, (GDestroyNotify)set_profile_context_free); g_task_set_task_data (task, ctx, (GDestroyNotify)set_profile_context_free);
@@ -725,9 +725,9 @@ mm_iface_modem_3gpp_profile_manager_set_profile (MMIfaceModem3gppProfileManager
g_assert_not_reached (); g_assert_not_reached ();
/* normalize IP family right away */ /* normalize IP family right away */
ip_family = mm_3gpp_profile_get_ip_type (requested); ip_family = mm_3gpp_profile_get_ip_type (ctx->requested);
mm_3gpp_normalize_ip_family (&ip_family); mm_3gpp_normalize_ip_family (&ip_family);
mm_3gpp_profile_set_ip_type (requested, ip_family); mm_3gpp_profile_set_ip_type (ctx->requested, ip_family);
set_profile_step (task); set_profile_step (task);
} }