Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90359
b: refs/heads/master
c: c978cd3
h: refs/heads/master
i:
  90357: d4941f5
  90355: 5c906f4
  90351: d61d655
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 26, 2008
1 parent 2907ed3 commit 7bcd1bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 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: 720ac7085ce815ea4caec24396575fed7bd711aa
refs/heads/master: c978cd3a937141deaf7995b849824af6dacdeae7
19 changes: 15 additions & 4 deletions trunk/net/ipv4/netfilter/nf_nat_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ static unsigned int ip_nat_sip(struct sk_buff *skb,
enum ip_conntrack_info ctinfo;
struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
unsigned int matchoff, matchlen;
unsigned int dataoff, matchoff, matchlen;
union nf_inet_addr addr;
__be16 port;
int request;
int request, in_header;

/* Basic rules: requests and responses. */
if (strnicmp(*dptr, "SIP/2.0", strlen("SIP/2.0")) != 0) {
Expand Down Expand Up @@ -187,9 +187,20 @@ static unsigned int ip_nat_sip(struct sk_buff *skb,
}

next:
/* Translate Contact headers */
dataoff = 0;
in_header = 0;
while (ct_sip_parse_header_uri(ct, *dptr, &dataoff, *datalen,
SIP_HDR_CONTACT, &in_header,
&matchoff, &matchlen,
&addr, &port) > 0) {
if (!map_addr(skb, dptr, datalen, matchoff, matchlen,
&addr, port))
return NF_DROP;
}

if (!map_sip_addr(skb, dptr, datalen, SIP_HDR_FROM) ||
!map_sip_addr(skb, dptr, datalen, SIP_HDR_TO) ||
!map_sip_addr(skb, dptr, datalen, SIP_HDR_CONTACT))
!map_sip_addr(skb, dptr, datalen, SIP_HDR_TO))
return NF_DROP;
return NF_ACCEPT;
}
Expand Down

0 comments on commit 7bcd1bb

Please sign in to comment.