aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-08-26 13:14:29 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2012-08-29 21:00:24 -0400
commit320ff567f299ed3f0a2d53906e632a1b0eda5599 (patch)
treec092f919ca8c0d144a75146a22dd3d0a71b5c590
parent5901b6be885e2c9a30fd94803b846b3d33e351dd (diff)
netfilter: nf_nat: support IPv6 in TFTP NAT helper
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r--net/ipv4/netfilter/Kconfig5
-rw-r--r--net/ipv4/netfilter/Makefile1
-rw-r--r--net/netfilter/Kconfig5
-rw-r--r--net/netfilter/Makefile1
-rw-r--r--net/netfilter/nf_conntrack_tftp.c3
-rw-r--r--net/netfilter/nf_nat_tftp.c (renamed from net/ipv4/netfilter/nf_nat_tftp.c)0
6 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
index 843fe17db20d..131e53702e77 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -221,11 +221,6 @@ config NF_NAT_PROTO_GRE
221 tristate 221 tristate
222 depends on NF_NAT_IPV4 && NF_CT_PROTO_GRE 222 depends on NF_NAT_IPV4 && NF_CT_PROTO_GRE
223 223
224config NF_NAT_TFTP
225 tristate
226 depends on NF_CONNTRACK && NF_NAT_IPV4
227 default NF_NAT_IPV4 && NF_CONNTRACK_TFTP
228
229config NF_NAT_PPTP 224config NF_NAT_PPTP
230 tristate 225 tristate
231 depends on NF_CONNTRACK && NF_NAT_IPV4 226 depends on NF_CONNTRACK && NF_NAT_IPV4
diff --git a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile
index 17e649bb98ba..b7dd18987237 100644
--- a/net/ipv4/netfilter/Makefile
+++ b/net/ipv4/netfilter/Makefile
@@ -23,7 +23,6 @@ obj-$(CONFIG_NF_DEFRAG_IPV4) += nf_defrag_ipv4.o
23obj-$(CONFIG_NF_NAT_H323) += nf_nat_h323.o 23obj-$(CONFIG_NF_NAT_H323) += nf_nat_h323.o
24obj-$(CONFIG_NF_NAT_PPTP) += nf_nat_pptp.o 24obj-$(CONFIG_NF_NAT_PPTP) += nf_nat_pptp.o
25obj-$(CONFIG_NF_NAT_SNMP_BASIC) += nf_nat_snmp_basic.o 25obj-$(CONFIG_NF_NAT_SNMP_BASIC) += nf_nat_snmp_basic.o
26obj-$(CONFIG_NF_NAT_TFTP) += nf_nat_tftp.o
27 26
28# NAT protocols (nf_nat) 27# NAT protocols (nf_nat)
29obj-$(CONFIG_NF_NAT_PROTO_GRE) += nf_nat_proto_gre.o 28obj-$(CONFIG_NF_NAT_PROTO_GRE) += nf_nat_proto_gre.o
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index cabe4da0e191..052836e2490e 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -400,6 +400,11 @@ config NF_NAT_SIP
400 depends on NF_CONNTRACK && NF_NAT 400 depends on NF_CONNTRACK && NF_NAT
401 default NF_NAT && NF_CONNTRACK_SIP 401 default NF_NAT && NF_CONNTRACK_SIP
402 402
403config NF_NAT_TFTP
404 tristate
405 depends on NF_CONNTRACK && NF_NAT
406 default NF_NAT && NF_CONNTRACK_TFTP
407
403endif # NF_CONNTRACK 408endif # NF_CONNTRACK
404 409
405# transparent proxy support 410# transparent proxy support
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
index 0dd792972cae..403ea8125884 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_NF_NAT_AMANDA) += nf_nat_amanda.o
59obj-$(CONFIG_NF_NAT_FTP) += nf_nat_ftp.o 59obj-$(CONFIG_NF_NAT_FTP) += nf_nat_ftp.o
60obj-$(CONFIG_NF_NAT_IRC) += nf_nat_irc.o 60obj-$(CONFIG_NF_NAT_IRC) += nf_nat_irc.o
61obj-$(CONFIG_NF_NAT_SIP) += nf_nat_sip.o 61obj-$(CONFIG_NF_NAT_SIP) += nf_nat_sip.o
62obj-$(CONFIG_NF_NAT_TFTP) += nf_nat_tftp.o
62 63
63# transparent proxy support 64# transparent proxy support
64obj-$(CONFIG_NETFILTER_TPROXY) += nf_tproxy_core.o 65obj-$(CONFIG_NETFILTER_TPROXY) += nf_tproxy_core.o
diff --git a/net/netfilter/nf_conntrack_tftp.c b/net/netfilter/nf_conntrack_tftp.c
index 9363e1c66466..81fc61c05263 100644
--- a/net/netfilter/nf_conntrack_tftp.c
+++ b/net/netfilter/nf_conntrack_tftp.c
@@ -72,8 +72,7 @@ static int tftp_help(struct sk_buff *skb,
72 nf_ct_dump_tuple(&exp->tuple); 72 nf_ct_dump_tuple(&exp->tuple);
73 73
74 nf_nat_tftp = rcu_dereference(nf_nat_tftp_hook); 74 nf_nat_tftp = rcu_dereference(nf_nat_tftp_hook);
75 if (nf_nat_tftp && nf_ct_l3num(ct) == NFPROTO_IPV4 && 75 if (nf_nat_tftp && ct->status & IPS_NAT_MASK)
76 ct->status & IPS_NAT_MASK)
77 ret = nf_nat_tftp(skb, ctinfo, exp); 76 ret = nf_nat_tftp(skb, ctinfo, exp);
78 else if (nf_ct_expect_related(exp) != 0) 77 else if (nf_ct_expect_related(exp) != 0)
79 ret = NF_DROP; 78 ret = NF_DROP;
diff --git a/net/ipv4/netfilter/nf_nat_tftp.c b/net/netfilter/nf_nat_tftp.c
index ccabbda71a3e..ccabbda71a3e 100644
--- a/net/ipv4/netfilter/nf_nat_tftp.c
+++ b/net/netfilter/nf_nat_tftp.c