diff options
author | Richard Röjfors <richard@puffinpack.se> | 2019-04-02 09:28:53 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2019-04-02 10:41:16 -0500 |
commit | b9fdba531f311023506b2e1ab4f47352c1cc9f99 (patch) | |
tree | de985454f87233971e22eca195b7f3f5aa7751f6 /src | |
parent | 05484bdb73c529b6cbcbcdd90d8d8d6656ef07cc (diff) | |
download | ofono-b9fdba531f311023506b2e1ab4f47352c1cc9f99.tar.gz |
gprs: Fix allocation of context id read from settings
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 <denkenz@gmail.com>
Date: Thu Jan 3 17:17:21 2019 -0600
gprs: Fix allocation of context id
Diffstat (limited to 'src')
-rw-r--r-- | src/gprs.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |