From: Patrick McHardy <kaber@trash.net>
To: netfilter-devel@vger.kernel.org
Cc: flo@degnet.de, Patrick McHardy <kaber@trash.net>, madduck@debian.org
Subject: netfilter: nf_conntrack_sip: fix ct_sip_parse_request() REGISTER request parsing
Date: Wed, 20 Jan 2010 20:18:29 +0100 (MET) [thread overview]
Message-ID: <20100120191827.25922.10679.sendpatchset@x2.localnet> (raw)
In-Reply-To: <20100120191824.25922.36663.sendpatchset@x2.localnet>
commit 854e013100d88995a6e25896bd426c303c888682
Author: Patrick McHardy <kaber@trash.net>
Date: Wed Jan 20 18:23:05 2010 +0100
netfilter: nf_conntrack_sip: fix ct_sip_parse_request() REGISTER request parsing
When requests are parsed, the "sip:" part of the SIP URI should be skipped.
Usually this doesn't matter because address parsing skips forward until after
the username part, but in case REGISTER requests it doesn't contain a username
and the address can not be parsed.
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 5b1c24e..ac71fa8 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -236,12 +236,13 @@ int ct_sip_parse_request(const struct nf_conn *ct,
return 0;
/* Find SIP URI */
- limit -= strlen("sip:");
- for (; dptr < limit; dptr++) {
+ for (; dptr < limit - strlen("sip:"); dptr++) {
if (*dptr == '\r' || *dptr == '\n')
return -1;
- if (strnicmp(dptr, "sip:", strlen("sip:")) == 0)
+ if (strnicmp(dptr, "sip:", strlen("sip:")) == 0) {
+ dptr += strlen("sip:");
break;
+ }
}
if (!skp_epaddr_len(ct, dptr, limit, &shift))
return 0;
next prev parent reply other threads:[~2010-01-20 19:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 19:18 netfilter 00/07: SIP TCP & T.38 support Patrick McHardy
2010-01-20 19:18 ` netfilter: nf_conntrack: show helper and class in /proc/net/nf_conntrack_expect Patrick McHardy
2010-01-20 19:37 ` Jan Engelhardt
2010-01-20 22:43 ` Patrick McHardy
2010-01-20 19:18 ` Patrick McHardy [this message]
2010-01-20 19:18 ` netfilter: nf_conntrack_sip: pass data offset to NAT functions Patrick McHardy
2010-01-20 19:18 ` netfilter: nf_conntrack_sip: add TCP support Patrick McHardy
2010-01-20 19:18 ` netfilter: nf_nat: support mangling a single TCP packet multiple times Patrick McHardy
2010-01-20 19:18 ` netfilter: nf_nat_sip: add TCP support Patrick McHardy
2010-01-20 19:18 ` netfilter: nf_conntrack_sip: add T.38 FAX support Patrick McHardy
2010-01-20 23:57 ` netfilter 00/07: SIP TCP & T.38 support Florian Fuessl
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=20100120191827.25922.10679.sendpatchset@x2.localnet \
--to=kaber@trash.net \
--cc=flo@degnet.de \
--cc=madduck@debian.org \
--cc=netfilter-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.