Skip to contentSkip to conversation

gprs: Fix allocation of context id read from settings

PATCH Applied [email protected] 2 participants 2 messages Apr 2, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gprs: Fix allocation of context id read from settings

From: Richard Röjfors <[email protected]>

This fix is similar to the one in the following commit, but fixes allocation for context ids after ap's are read from settings.

commit c3fdf6a7c567a7507c3558a27006b6f9559493d6

Author: Denis Kenzior <[email protected]>
Date:   Thu Jan 3 17:17:21 2019 -0600

gprs: Fix allocation of context id

---
 src/gprs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
src/gprs.c +5 -1
index b0d56e1e..d432c9fd 100644
@@ -2340,7 +2340,11 @@ static void provision_context(const struct ofono_gprs_provision_data *ap,
 			strlen(ap->message_center) > MAX_MESSAGE_CENTER_LENGTH)
 		return;
 
-	id = l_uintset_find_unused(gprs->used_pids, gprs->last_context_id);
+	if (gprs->last_context_id)
+		id = l_uintset_find_unused(gprs->used_pids,
+							gprs->last_context_id);
+	else
+		id = l_uintset_find_unused_min(gprs->used_pids);
 	if (id > l_uintset_get_max(gprs->used_pids))
 		return;
 
Signature · 1 line
2.19.1
#1 lore raw

Hi Richard,

Quoted 6 lines · richard.rojfors(a)gmail.com

From: Richard Röjfors <[email protected]>

This fix is similar to the one in the following commit, but fixes allocation for context ids after ap's are read from settings.

Quoted 8 lines

commit c3fdf6a7c567a7507c3558a27006b6f9559493d6

Author: Denis Kenzior <[email protected]>
Date:   Thu Jan 3 17:17:21 2019 -0600

gprs: Fix allocation of context id

---
  src/gprs.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

Applied, thanks.

Regards,
-Denis