[OpenSIPS-Devel] [ opensips-Patches-2044475 ] Matching operators fail to match on some platforms

SourceForge.net noreply at sourceforge.net
Sun Aug 10 11:58:58 CEST 2008


Patches item #2044475, was opened at 2008-08-10 03:47
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2044475&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.4.x
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Amy Linari (amylinari)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: Matching operators fail to match on some platforms

Initial Comment:
Due to a bug in route.c, the regular expression matching operators do not
work in all environments. For example, when building 1.4.0 or 1.3.2 on
Solaris 10 (sun4v or x86) they give the same result independent of input.
It would seem that if it were not for the accident of a particular struct
alignment, these operators would be broken on all platforms.

The underlying problem is a bad test in comp_s2s, which expects s2 to be a
str*, and tests st->s==NULL. When handling the matching operators MATCH_OP
and NOTMATCH_OP, it is a regex_t* instead - a fact reflected in the cast
under the appropriate switch case.

The attached patch moves these special case tests into a new function
comp_s2r which handles MATCH_OP and NOTMATCH_OP comparisons with the
correct types and tests. The corresponding patch for kamailio 1.3.2 has been filed and tested. This version of the patch has NOT been tested, but should work properly.

----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2008-08-10 12:58

Message:
Logged In: YES 
user_id=1275325
Originator: NO

Hi Amy,

Thank you for pointing out the problem - unfortunately the uploaded patch
was incomplete, but i figured out what was the fixed you did :). I tried a
different version to keep a single function and to place specific param
tests inside the "switch".

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2044475&group_id=232389



More information about the Devel mailing list