Skip to content

Commit

Permalink
[NETFILTER]: nf_nat_sip: only perform RTP DNAT if SIP session was SNATed
Browse files Browse the repository at this point in the history
DNAT of the the RTP session is only necessary if the SIP session has
been SNATed.

Signed-off-by: Jerome Borsboom <j.borsboom@erasmusmc.nl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jerome Borsboom authored and David S. Miller committed Jul 11, 2007
1 parent 7c4e36b commit f4a607b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/ipv4/netfilter/nf_nat_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ static unsigned int ip_nat_sdp(struct sk_buff **pskb,
DEBUGP("ip_nat_sdp():\n");

/* Connection will come from reply */
newip = ct->tuplehash[!dir].tuple.dst.u3.ip;
if (ct->tuplehash[dir].tuple.src.u3.ip ==
ct->tuplehash[!dir].tuple.dst.u3.ip)
newip = exp->tuple.dst.u3.ip;
else
newip = ct->tuplehash[!dir].tuple.dst.u3.ip;

exp->saved_ip = exp->tuple.dst.u3.ip;
exp->tuple.dst.u3.ip = newip;
Expand Down

0 comments on commit f4a607b

Please sign in to comment.