From 4d2d01b2c6a0819d941a4ef2d257e5392af3e24f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 6 Mar 2025 08:33:29 -0600 Subject: broadband-bearer,modem-helpers: don't use or match disabled profiles When matching profiles ignore disabled ones. When activating a specific profile index, return an error if that profile is marked as disabled. Signed-off-by: Dan Williams --- src/mm-modem-helpers.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mm-modem-helpers.c') diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 574ec7fc..fcb44ad2 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1677,6 +1677,12 @@ mm_3gpp_profile_list_find_best (GList *profile_list, continue; } + /* Never select disabled profiles */ + if (!mm_3gpp_profile_get_enabled (iter_profile)) { + mm_obj_dbg (log_object, "skipping context at profile %d: disabled", iter_profile_id); + continue; + } + /* Always prefer an exact match; compare all supported fields except for profile id */ if (mm_3gpp_profile_cmp (iter_profile, requested, cmp_apn, cmp_flags)) { mm_obj_dbg (log_object, "found exact context at profile %d", iter_profile_id); -- cgit v1.2.3-70-g09d2