[Bug 532] ip_nat_sip rewrote Call-ID instead of Contact - patch attached

bugzilla-daemon at bugzilla.netfilter.org bugzilla-daemon at bugzilla.netfilter.org
Sat Jan 27 19:43:52 CET 2007


https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=532





------- Additional Comments From lars at ibp.de  2007-01-27 19:43 MET -------
(In reply to comment #1)
> (In reply to comment #0)
> > 
> > The fix should be safe, even in the presence of clients that use 
> > continuation lines.
> 
> It it really? I think it will fail at something like this:
> 
> Contact:
>   xyz at 1.2.3.4

Yes, that would fail, but it's not a valid Contact header (the URI scheme is
missing). A Contact header like:

Contact:
    sip:xyz at 1.2.3.4

would work, because the current code will scan for the "sip:".

This one would fail, but it's also invalid:

Contact: sip:
   xyz at 1.2.3.4 

> (BTW, please include a Signed-off-by: line).

I am a newbie; thanks.

What about this:

When trying to skip over the username in the Contact header, stop at the
end of the line if no @ is found. We don't need to worry about continuation
lines, because we search inside a SIP URI.

X-Signed-off-by: Lars Immisch <lars at ibp.de>

--- ip_conntrack_sip.orig       2007-01-18 01:25:24.000000000 +0100
+++ ip_conntrack_sip.c  2007-01-27 18:31:38.000000000 +0100
@@ -247,7 +247,11 @@
 {
        int s = *shift;
 
-       for (; dptr <= limit && *dptr != '@'; dptr++)
+       // Search for @, but stop at the end of the line.
+       // We are inside a sip: URI, so we don't need to worry about 
+       // continuation lines.
+       for (; dptr <= limit && *dptr != '@' && 
+                        *dptr != '\r' && *dptr != '\n'; dptr++)
                (*shift)++;
 
        if (*dptr == '@') {

-- 
Configure bugmail: https://bugzilla.netfilter.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the netfilter-buglog mailing list