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

Commit 2f9616d4 authored by Marcus Sundberg's avatar Marcus Sundberg Committed by David S. Miller
Browse files

[NETFILTER]: ip_nat_tftp: Fix expectation NAT



When a TFTP client is SNATed so that the port is also changed, the
port is never changed back for the expected connection.

Signed-off-by: default avatarMarcus Sundberg <marcus@ingate.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 66e05225
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -42,7 +42,10 @@ static unsigned int help(struct sk_buff **pskb,
			 enum ip_conntrack_info ctinfo,
			 struct ip_conntrack_expect *exp)
{
	exp->saved_proto.udp.port = exp->tuple.dst.u.tcp.port;
	struct ip_conntrack *ct = exp->master;

	exp->saved_proto.udp.port
		= ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.udp.port;
	exp->dir = IP_CT_DIR_REPLY;
	exp->expectfn = ip_nat_follow_master;
	if (ip_conntrack_expect_related(exp) != 0)