aboutsummaryrefslogtreecommitdiff
path: root/src/mm-iface-modem-3gpp.c
diff options
context:
space:
mode:
authorEric Caruso <ejcaruso@chromium.org>2023-01-31 16:26:36 -0500
committerEric Caruso <ejcaruso@chromium.org>2023-02-03 21:09:36 +0000
commite31c43ebd23ca64912b0a1b6607a03c4bf0049d7 (patch)
tree74accbf165bafda6c9eb1837a5fc9fc285ce3cc7 /src/mm-iface-modem-3gpp.c
parent652a562aebcd22e16962ec57c0176acdbf41876a (diff)
mm-iface-modem-3gpp: reject unspecified values for 5G reg settings
It seems like users can put the "unsupported" value for both DRX cycle and MICO mode, so we should reject that.
Diffstat (limited to 'src/mm-iface-modem-3gpp.c')
-rw-r--r--src/mm-iface-modem-3gpp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index 6766ddf6..786d2bc0 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -1697,6 +1697,8 @@ set_nr5g_registration_settings_auth_ready (MMBaseModem
GError *error = NULL;
GVariant *old_dictionary;
g_autoptr(MMNr5gRegistrationSettings) old_settings = NULL;
+ MMModem3gppDrxCycle new_drx_cycle;
+ MMModem3gppMicoMode new_mico_mode;
if (!mm_base_modem_authorize_finish (self, res, &error)) {
g_dbus_method_invocation_take_error (ctx->invocation, error);
@@ -1720,6 +1722,24 @@ set_nr5g_registration_settings_auth_ready (MMBaseModem
return;
}
+ new_drx_cycle = mm_nr5g_registration_settings_get_drx_cycle (ctx->settings);
+ if (new_drx_cycle == MM_MODEM_3GPP_DRX_CYCLE_UNSUPPORTED) {
+ g_set_error (&error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Invalid value for DRX cycle: %s",
+ mm_modem_3gpp_drx_cycle_get_string (new_drx_cycle));
+ g_dbus_method_invocation_take_error (ctx->invocation, error);
+ handle_set_nr5g_registration_settings_context_free (ctx);
+ return;
+ }
+
+ new_mico_mode = mm_nr5g_registration_settings_get_mico_mode (ctx->settings);
+ if (new_mico_mode == MM_MODEM_3GPP_MICO_MODE_UNSUPPORTED) {
+ g_set_error (&error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Invalid value for MICO mode: %s",
+ mm_modem_3gpp_mico_mode_get_string (new_mico_mode));
+ g_dbus_method_invocation_take_error (ctx->invocation, error);
+ handle_set_nr5g_registration_settings_context_free (ctx);
+ return;
+ }
+
mm_obj_info (self, "processing user request to set 5GNR registration settings...");
old_dictionary = mm_gdbus_modem3gpp_get_nr5g_registration_settings (ctx->skeleton);