summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-11-29 02:35:28 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:31:25 -0800
commit77a78dec48386ce958196bf69f192ee76537c07d (patch)
tree89b8f6f0719df37715958c0ed9b0250476d44447 /net
parent40883e8184947879f135605a05c0764c60656cc5 (diff)
[NETFILTER]: sip conntrack: make header shortcuts optional
Not every header has a shortcut, so make them optional instead of searching for the same string twice. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/netfilter/ip_conntrack_sip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_sip.c b/net/ipv4/netfilter/ip_conntrack_sip.c
index a9c0d1d3e56f..0a6a13c45b07 100644
--- a/net/ipv4/netfilter/ip_conntrack_sip.c
+++ b/net/ipv4/netfilter/ip_conntrack_sip.c
@@ -72,8 +72,6 @@ static struct sip_header_nfo ct_sip_hdrs[] = {
[POS_REQ_HEADER] = { /* SIP Requests headers */
.lname = "sip:",
.lnlen = sizeof("sip:") - 1,
- .sname = "sip:",
- .snlen = sizeof("sip:") - 1, /* yes, i know.. ;) */
.ln_str = "@",
.ln_strlen = sizeof("@") - 1,
.match_len = epaddr_len
@@ -286,7 +284,8 @@ int ct_sip_get_info(const char *dptr, size_t dlen,
while (dptr <= limit) {
if ((strncmp(dptr, hnfo->lname, hnfo->lnlen) != 0) &&
- (strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) {
+ (hinfo->sname == NULL ||
+ strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) {
dptr++;
continue;
}