Commit 77a78dec authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[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: default avatarPatrick McHardy <kaber@trash.net>
parent 40883e81
...@@ -72,8 +72,6 @@ static struct sip_header_nfo ct_sip_hdrs[] = { ...@@ -72,8 +72,6 @@ static struct sip_header_nfo ct_sip_hdrs[] = {
[POS_REQ_HEADER] = { /* SIP Requests headers */ [POS_REQ_HEADER] = { /* SIP Requests headers */
.lname = "sip:", .lname = "sip:",
.lnlen = sizeof("sip:") - 1, .lnlen = sizeof("sip:") - 1,
.sname = "sip:",
.snlen = sizeof("sip:") - 1, /* yes, i know.. ;) */
.ln_str = "@", .ln_str = "@",
.ln_strlen = sizeof("@") - 1, .ln_strlen = sizeof("@") - 1,
.match_len = epaddr_len .match_len = epaddr_len
...@@ -286,7 +284,8 @@ int ct_sip_get_info(const char *dptr, size_t dlen, ...@@ -286,7 +284,8 @@ int ct_sip_get_info(const char *dptr, size_t dlen,
while (dptr <= limit) { while (dptr <= limit) {
if ((strncmp(dptr, hnfo->lname, hnfo->lnlen) != 0) && 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++; dptr++;
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment