[ovs-dev] [PATCH net-next 6/8] netfilter: nf_nat: register sip NAT helper.

Flavio Leitner fbl at sysclose.org
Tue Mar 26 20:57:13 UTC 2019


Signed-off-by: Flavio Leitner <fbl at sysclose.org>
---
 net/netfilter/nf_nat_sip.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_nat_sip.c b/net/netfilter/nf_nat_sip.c
index f31c2a1b95b8..42b3d2e7ecbd 100644
--- a/net/netfilter/nf_nat_sip.c
+++ b/net/netfilter/nf_nat_sip.c
@@ -29,6 +29,7 @@ MODULE_AUTHOR("Christian Hentschel <chentschel at arnet.com.ar>");
 MODULE_DESCRIPTION("SIP NAT helper");
 MODULE_ALIAS_NFCT_HELPER_NAT("sip");
 
+static struct nf_conntrack_helper_nat helper_nat_sip;
 
 static unsigned int mangle_packet(struct sk_buff *skb, unsigned int protoff,
 				  unsigned int dataoff,
@@ -656,8 +657,8 @@ static struct nf_ct_helper_expectfn sip_nat = {
 
 static void __exit nf_nat_sip_fini(void)
 {
+	nf_conntrack_helper_nat_unregister(&helper_nat_sip);
 	RCU_INIT_POINTER(nf_nat_sip_hooks, NULL);
-
 	nf_ct_helper_expectfn_unregister(&sip_nat);
 	synchronize_rcu();
 }
@@ -675,6 +676,9 @@ static const struct nf_nat_sip_hooks sip_hooks = {
 static int __init nf_nat_sip_init(void)
 {
 	BUG_ON(nf_nat_sip_hooks != NULL);
+	nf_ct_helper_nat_init(&helper_nat_sip,
+			      NF_CT_NAT_HELPER_MOD_NAME("sip"), THIS_MODULE);
+	nf_conntrack_helper_nat_register(&helper_nat_sip);
 	RCU_INIT_POINTER(nf_nat_sip_hooks, &sip_hooks);
 	nf_ct_helper_expectfn_register(&sip_nat);
 	return 0;
-- 
2.20.1





More information about the dev mailing list