[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190326205715.22288-4-fbl@sysclose.org>
Date: Tue, 26 Mar 2019 17:57:10 -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 3/8] netfilter: nf_nat: register amanda NAT helper.
Signed-off-by: Flavio Leitner <fbl@...close.org>
---
net/netfilter/nf_nat_amanda.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/netfilter/nf_nat_amanda.c b/net/netfilter/nf_nat_amanda.c
index e87075763f73..344096418224 100644
--- a/net/netfilter/nf_nat_amanda.c
+++ b/net/netfilter/nf_nat_amanda.c
@@ -24,6 +24,8 @@ MODULE_DESCRIPTION("Amanda NAT helper");
MODULE_LICENSE("GPL");
MODULE_ALIAS_NFCT_HELPER_NAT("amanda");
+static struct nf_conntrack_helper_nat helper_nat_amanda;
+
static unsigned int help(struct sk_buff *skb,
enum ip_conntrack_info ctinfo,
unsigned int protoff,
@@ -74,6 +76,7 @@ static unsigned int help(struct sk_buff *skb,
static void __exit nf_nat_amanda_fini(void)
{
+ nf_conntrack_helper_nat_unregister(&helper_nat_amanda);
RCU_INIT_POINTER(nf_nat_amanda_hook, NULL);
synchronize_rcu();
}
@@ -81,6 +84,10 @@ static void __exit nf_nat_amanda_fini(void)
static int __init nf_nat_amanda_init(void)
{
BUG_ON(nf_nat_amanda_hook != NULL);
+ nf_ct_helper_nat_init(&helper_nat_amanda,
+ NF_CT_NAT_HELPER_MOD_NAME("amanda"),
+ THIS_MODULE);
+ nf_conntrack_helper_nat_register(&helper_nat_amanda);
RCU_INIT_POINTER(nf_nat_amanda_hook, help);
return 0;
}
--
2.20.1
Powered by blists - more mailing lists