diff options
author | Marcus Sundberg <marcus@ingate.com> | 2005-12-12 15:02:48 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-12-12 15:02:48 -0800 |
commit | 2f9616d4c44349c903bc1b54fe46ab0ce0210b74 (patch) | |
tree | a26737c50950261b92d9cc948d7e29053f30466e /net/ipv4 | |
parent | 66e05225262cd9271fac13fe2fd1e9edb65e3978 (diff) | |
download | op-kernel-dev-2f9616d4c44349c903bc1b54fe46ab0ce0210b74.zip op-kernel-dev-2f9616d4c44349c903bc1b54fe46ab0ce0210b74.tar.gz |
[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: Marcus Sundberg <marcus@ingate.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ip_nat_tftp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/ip_nat_tftp.c b/net/ipv4/netfilter/ip_nat_tftp.c index 2215317..43c3bd7 100644 --- a/net/ipv4/netfilter/ip_nat_tftp.c +++ b/net/ipv4/netfilter/ip_nat_tftp.c @@ -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) |