diff options
author | Sven Schwermer <sven.schwermer@disruptive-technologies.com> | 2022-03-08 15:30:50 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-03-09 22:43:20 +0000 |
commit | 95eef34d37948118c212962d63490f6f78caa30b (patch) | |
tree | 1056d640de6f7e3a89a515c93aba832fde4c0cdb /src | |
parent | c74a377f9881f7fcdf2c8cab0b5a5378692cf6d2 (diff) |
modem-helpers: Consider minimum ID when choosing best profile
+CGDCONT? may list profiles with IDs that are illegal to write, i.e.
+CGDCONT=? returns a minimum ID larger than some of the existing
profiles. E.g. for Fibocom L610-EU, +CGDCONT=? returns
+CGDCONT: (1-7),"IP",,,(0-3),(0-4)
+CGDCONT: (1-7),"IPV6",,,(0-3),(0-4)
+CGDCONT: (1-7),"IPV4V6",,,(0-3),(0-4)
+CGDCONT: (1-7),"PPP",,,(0-3),(0-4)
+CGDCONT: (1-7),"Non-IP",,,(0-3),(0-4)
while the default EPS bearer is established at profile 0:
+CGDCONT: 0,"IP","xxx","xxx.xxx.xxx.xxx",0,0
[...]
Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-modem-helpers.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index c969b665..a780b15f 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1629,6 +1629,11 @@ mm_3gpp_profile_list_find_best (GList *profile_list, iter_profile_id = mm_3gpp_profile_get_profile_id (iter_profile); + if (iter_profile_id < min_profile_id) { + mm_obj_dbg (log_object, "skipping context at profile %d: out of bounds", 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); |