Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4a607bf authored by Jerome Borsboom's avatar Jerome Borsboom Committed by David S. Miller
Browse files

[NETFILTER]: nf_nat_sip: only perform RTP DNAT if SIP session was SNATed



DNAT of the the RTP session is only necessary if the SIP session has
been SNATed.

Signed-off-by: default avatarJerome Borsboom <j.borsboom@erasmusmc.nl>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c4e36bc
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -260,6 +260,10 @@ static unsigned int ip_nat_sdp(struct sk_buff **pskb,
	DEBUGP("ip_nat_sdp():\n");

	/* Connection will come from reply */
	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;