[sr-dev] uris in group 0
Daniel-Constantin Mierla
miconda at gmail.com
Mon Jun 25 10:33:54 CEST 2012
Hello,
On 6/23/12 7:58 PM, Avi Brender wrote:
> Hi,
>
> We've come across a problem where URIs that are in the IP state
> (inactive - pinging) aren't being set to the 'active' state after a
> successful ping probe. We've sifted through the code and found that
> modules_k/dispatcher/dispatch.c has this code in the
> ds_option_callback() function, on line 2328:
> if (*ps->param == NULL)
> {
> LM_DBG("No parameter provided, OPTIONS-Request was finished"
> " with code %d\n", ps->code);
> return;
> }
>
> When the group (ie *ps->param) is 0 then that statement evaluates to
> true and the function returns without executing the callback. For
> groups > 0 the code works fine.
>
> To fix this we've changed the statement to:
> if (ps->param == NULL)
>
> If you have any questions, comments or feed back please let me know.
> If that change gets accepted please let me know as well so that we can
> remove the patch from our build systems.
>
> Thanks for the great software!
iirc, ps->param cannot be null as it is given as address of a field in
an existing structure.
You are right regarding the group id 0 in this case. 0 should be avoided
usually when expecting to get the value in cofing file, which means stop
execution of the config file -- it happened with permissions where is a
function returning the group, now there 0 is not allowed.
I will commit your fix for now, but might be better to disallow set id 0
to avoid possible troubles in the future.
Thanks,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - http://asipto.com/u/kpw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20120625/814f29ac/attachment.htm>
More information about the sr-dev
mailing list