[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190326205715.22288-5-fbl@sysclose.org>
Date: Tue, 26 Mar 2019 17:57:11 -0300
From: Flavio Leitner <fbl@...close.org>
To: netdev@...r.kernel.org
Cc: Joe Stringer <joe@....org>, Pravin B Shelar <pshelar@....org>,
dev@...nvswitch.org, netfilter-devel@...r.kernel.org
Subject: [PATCH net-next 4/8] netfilter: nf_nat: register ftp NAT helper.
Signed-off-by: Flavio Leitner <fbl@...close.org>
---
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
Powered by blists - more mailing lists