Thread (16 messages) 16 messages, 3 authors, 2019-04-11
STALE2619d

[PATCH net-next 4/8] netfilter: nf_nat: register ftp NAT helper.

From: Flavio Leitner <hidden>
Date: 2019-03-26 20:57:58
Also in: netfilter-devel
Subsystem: netfilter, networking [general], the rest · Maintainers: Pablo Neira Ayuso, Florian Westphal, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Signed-off-by: Flavio Leitner <redacted>
---
 net/netfilter/nf_nat_ftp.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/net/netfilter/nf_nat_ftp.c b/net/netfilter/nf_nat_ftp.c
index 19f5739fd5e2..70fddcddad54 100644
--- a/net/netfilter/nf_nat_ftp.c
+++ b/net/netfilter/nf_nat_ftp.c
@@ -28,6 +28,8 @@ MODULE_ALIAS_NFCT_HELPER_NAT("ftp");
 
 /* FIXME: Time out? --RR */
 
+static struct nf_conntrack_helper_nat helper_nat_ftp;
+
 static int nf_nat_ftp_fmt_cmd(struct nf_conn *ct, enum nf_ct_ftp_type type,
 			      char *buffer, size_t buflen,
 			      union nf_inet_addr *addr, u16 port)
@@ -124,6 +126,7 @@ static unsigned int nf_nat_ftp(struct sk_buff *skb,
 
 static void __exit nf_nat_ftp_fini(void)
 {
+	nf_conntrack_helper_nat_unregister(&helper_nat_ftp);
 	RCU_INIT_POINTER(nf_nat_ftp_hook, NULL);
 	synchronize_rcu();
 }
@@ -131,6 +134,9 @@ static void __exit nf_nat_ftp_fini(void)
 static int __init nf_nat_ftp_init(void)
 {
 	BUG_ON(nf_nat_ftp_hook != NULL);
+	nf_ct_helper_nat_init(&helper_nat_ftp,
+			      NF_CT_NAT_HELPER_MOD_NAME("ftp"), THIS_MODULE);
+	nf_conntrack_helper_nat_register(&helper_nat_ftp);
 	RCU_INIT_POINTER(nf_nat_ftp_hook, nf_nat_ftp);
 	return 0;
 }
-- 
2.20.1


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help