Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90354
b: refs/heads/master
c: 33cb1e9
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 26, 2008
1 parent 291c674 commit 7a034c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30f33e6dee80c6ded917f978e4f377d1069d519d
refs/heads/master: 33cb1e9a93312f0cdd34e0be2bc88e893ff96a33
3 changes: 0 additions & 3 deletions trunk/net/ipv4/netfilter/nf_nat_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ static unsigned int ip_nat_sip(struct sk_buff *skb,
union nf_inet_addr addr;
__be16 port;

if (*datalen < strlen("SIP/2.0"))
return NF_ACCEPT;

/* Basic rules: requests and responses. */
if (strnicmp(*dptr, "SIP/2.0", strlen("SIP/2.0")) != 0) {
if (ct_sip_parse_request(ct, *dptr, *datalen,
Expand Down
19 changes: 11 additions & 8 deletions trunk/net/netfilter/nf_conntrack_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ static int sip_help(struct sk_buff *skb,
{
unsigned int dataoff, datalen;
const char *dptr;
int ret;
typeof(nf_nat_sip_hook) nf_nat_sip;

/* No Data ? */
Expand All @@ -716,20 +717,22 @@ static int sip_help(struct sk_buff *skb,
return NF_ACCEPT;
}

nf_nat_sip = rcu_dereference(nf_nat_sip_hook);
if (nf_nat_sip && ct->status & IPS_NAT_MASK) {
if (!nf_nat_sip(skb, &dptr, &datalen))
return NF_DROP;
}

datalen = skb->len - dataoff;
if (datalen < strlen("SIP/2.0 200"))
return NF_ACCEPT;

if (strnicmp(dptr, "SIP/2.0 ", strlen("SIP/2.0 ")) != 0)
return process_sip_request(skb, &dptr, &datalen);
ret = process_sip_request(skb, &dptr, &datalen);
else
return process_sip_response(skb, &dptr, &datalen);
ret = process_sip_response(skb, &dptr, &datalen);

if (ret == NF_ACCEPT && ct->status & IPS_NAT_MASK) {
nf_nat_sip = rcu_dereference(nf_nat_sip_hook);
if (nf_nat_sip && !nf_nat_sip(skb, &dptr, &datalen))
ret = NF_DROP;
}

return ret;
}

static struct nf_conntrack_helper sip[MAX_PORTS][2] __read_mostly;
Expand Down

0 comments on commit 7a034c4

Please sign in to comment.