Skip to content

Commit

Permalink
[NETFILTER]: sip conntrack: make header shortcuts optional
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Dec 3, 2006
1 parent 40883e8 commit 77a78de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/ipv4/netfilter/ip_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 77a78de

Please sign in to comment.