Commit aa584eda authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: nf_conntrack_sip: fix SIP-URI parsing



The userinfo component of a SIP-URI is optional, continue parsing at the
beginning of the SIP-URI in case its not found.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 465f90a4
...@@ -295,6 +295,7 @@ static int epaddr_len(struct nf_conn *ct, const char *dptr, ...@@ -295,6 +295,7 @@ static int epaddr_len(struct nf_conn *ct, const char *dptr,
static int skp_epaddr_len(struct nf_conn *ct, const char *dptr, static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
const char *limit, int *shift) const char *limit, int *shift)
{ {
const char *start = dptr;
int s = *shift; int s = *shift;
/* Search for @, but stop at the end of the line. /* Search for @, but stop at the end of the line.
...@@ -309,8 +310,10 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr, ...@@ -309,8 +310,10 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
if (dptr <= limit && *dptr == '@') { if (dptr <= limit && *dptr == '@') {
dptr++; dptr++;
(*shift)++; (*shift)++;
} else } else {
dptr = start;
*shift = s; *shift = s;
}
return epaddr_len(ct, dptr, limit, shift); return epaddr_len(ct, dptr, limit, shift);
} }
......
Supports Markdown
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