From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] gprs: fix allocation of context id
Date: Wed, 02 Jan 2019 12:20:11 -0600 [thread overview]
Message-ID: <a157aca0-0a18-b0bb-0d05-cf96f55f6879@gmail.com> (raw)
In-Reply-To: <20190102115053.79191-1-martin@geanix.com>
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]
Hi Martin,
On 01/02/2019 05:50 AM, Martin Hundebøll wrote:
> After the convertion to l_uintset, the creation of new contexts fails
> due to a range error being returned from l_uintset_find_unused().
>
> The error happens because the uinset is created with a min-value of 1,
> but the start-value passed to l_uintset_find_unused() is initialized as
> 0.
Whoops, my bad. I forgot how my own API works.
>
> Fix this by passing a start-value just past the last allocated context
> id.
Won't this return an error if the last_context_id is at max? I think
the right fix is to back to the original logic, where
if (!gprs->last_context_id)
id = l_uintset_find_unused_min();
else
id = l_uintset_find-unused();
> ---
> src/gprs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Regards,
-Denis
prev parent reply other threads:[~2019-01-02 18:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 11:50 [PATCH] gprs: fix allocation of context id Martin =?unknown-8bit?q?Hundeb=C3=B8ll?=
2019-01-02 11:50 ` [PATCH] provision: allow duplicate apn's from mbpi Martin =?unknown-8bit?q?Hundeb=C3=B8ll?=
2019-01-02 18:36 ` Denis Kenzior
2019-01-04 14:03 ` Martin =?unknown-8bit?q?Hundeb=C3=B8ll?=
2019-01-04 21:03 ` Denis Kenzior
2019-01-07 8:50 ` Martin =?unknown-8bit?q?Hundeb=C3=B8ll?=
2019-01-08 17:50 ` Denis Kenzior
2019-01-02 18:20 ` Denis Kenzior [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a157aca0-0a18-b0bb-0d05-cf96f55f6879@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox