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

[PATCH net-next 7/8] netfilter: nf_nat: register tftp NAT helper.

From: Flavio Leitner <hidden>
Date: 2019-03-26 20:58:14
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_tftp.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/net/netfilter/nf_nat_tftp.c b/net/netfilter/nf_nat_tftp.c
index 51673aa6e1dc..5a7af30e3e02 100644
--- a/net/netfilter/nf_nat_tftp.c
+++ b/net/netfilter/nf_nat_tftp.c
@@ -18,6 +18,8 @@ MODULE_DESCRIPTION("TFTP NAT helper");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_NFCT_HELPER_NAT("tftp");
 
+static struct nf_conntrack_helper_nat helper_nat_tftp;
+
 static unsigned int help(struct sk_buff *skb,
 			 enum ip_conntrack_info ctinfo,
 			 struct nf_conntrack_expect *exp)
@@ -37,6 +39,7 @@ static unsigned int help(struct sk_buff *skb,
 
 static void __exit nf_nat_tftp_fini(void)
 {
+	nf_conntrack_helper_nat_unregister(&helper_nat_tftp);
 	RCU_INIT_POINTER(nf_nat_tftp_hook, NULL);
 	synchronize_rcu();
 }
@@ -44,6 +47,9 @@ static void __exit nf_nat_tftp_fini(void)
 static int __init nf_nat_tftp_init(void)
 {
 	BUG_ON(nf_nat_tftp_hook != NULL);
+	nf_ct_helper_nat_init(&helper_nat_tftp,
+			      NF_CT_NAT_HELPER_MOD_NAME("tftp"), THIS_MODULE);
+	nf_conntrack_helper_nat_register(&helper_nat_tftp);
 	RCU_INIT_POINTER(nf_nat_tftp_hook, help);
 	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