diff options
author | Patrick McHardy <kaber@trash.net> | 2006-11-28 20:35:28 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:31:25 -0500 |
commit | 77a78dec48386ce958196bf69f192ee76537c07d (patch) | |
tree | 89b8f6f0719df37715958c0ed9b0250476d44447 /net/ipv4 | |
parent | 40883e8184947879f135605a05c0764c60656cc5 (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/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_sip.c | 5 |
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[] = { | |||
72 | [POS_REQ_HEADER] = { /* SIP Requests headers */ | 72 | [POS_REQ_HEADER] = { /* SIP Requests headers */ |
73 | .lname = "sip:", | 73 | .lname = "sip:", |
74 | .lnlen = sizeof("sip:") - 1, | 74 | .lnlen = sizeof("sip:") - 1, |
75 | .sname = "sip:", | ||
76 | .snlen = sizeof("sip:") - 1, /* yes, i know.. ;) */ | ||
77 | .ln_str = "@", | 75 | .ln_str = "@", |
78 | .ln_strlen = sizeof("@") - 1, | 76 | .ln_strlen = sizeof("@") - 1, |
79 | .match_len = epaddr_len | 77 | .match_len = epaddr_len |
@@ -286,7 +284,8 @@ int ct_sip_get_info(const char *dptr, size_t dlen, | |||
286 | 284 | ||
287 | while (dptr <= limit) { | 285 | while (dptr <= limit) { |
288 | if ((strncmp(dptr, hnfo->lname, hnfo->lnlen) != 0) && | 286 | if ((strncmp(dptr, hnfo->lname, hnfo->lnlen) != 0) && |
289 | (strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) { | 287 | (hinfo->sname == NULL || |
288 | strncmp(dptr, hnfo->sname, hnfo->snlen) != 0)) { | ||
290 | dptr++; | 289 | dptr++; |
291 | continue; | 290 | continue; |
292 | } | 291 | } |