netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Flavio Leitner <fbl@sysclose.org>
To: netdev@vger.kernel.org
Cc: Joe Stringer <joe@ovn.org>, Pravin B Shelar <pshelar@ovn.org>,
	dev@openvswitch.org, netfilter-devel@vger.kernel.org
Subject: [PATCH net-next 5/8] netfilter: nf_nat: register irc NAT helper.
Date: Tue, 26 Mar 2019 17:57:12 -0300	[thread overview]
Message-ID: <20190326205715.22288-6-fbl@sysclose.org> (raw)
In-Reply-To: <20190326205715.22288-1-fbl@sysclose.org>

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

diff --git a/net/netfilter/nf_nat_irc.c b/net/netfilter/nf_nat_irc.c
index c18e3ce6589b..853e91c1cea5 100644
--- a/net/netfilter/nf_nat_irc.c
+++ b/net/netfilter/nf_nat_irc.c
@@ -28,6 +28,8 @@ MODULE_DESCRIPTION("IRC (DCC) NAT helper");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_NFCT_HELPER_NAT("irc");
 
+static struct nf_conntrack_helper_nat helper_nat_irc;
+
 static unsigned int help(struct sk_buff *skb,
 			 enum ip_conntrack_info ctinfo,
 			 unsigned int protoff,
@@ -96,6 +98,7 @@ static unsigned int help(struct sk_buff *skb,
 
 static void __exit nf_nat_irc_fini(void)
 {
+	nf_conntrack_helper_nat_unregister(&helper_nat_irc);
 	RCU_INIT_POINTER(nf_nat_irc_hook, NULL);
 	synchronize_rcu();
 }
@@ -103,6 +106,9 @@ static void __exit nf_nat_irc_fini(void)
 static int __init nf_nat_irc_init(void)
 {
 	BUG_ON(nf_nat_irc_hook != NULL);
+	nf_ct_helper_nat_init(&helper_nat_irc,
+			      NF_CT_NAT_HELPER_MOD_NAME("irc"), THIS_MODULE);
+	nf_conntrack_helper_nat_register(&helper_nat_irc);
 	RCU_INIT_POINTER(nf_nat_irc_hook, help);
 	return 0;
 }
-- 
2.20.1




  parent reply	other threads:[~2019-03-26 20:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 20:57 [PATCH net-next 0/8] openvswitch: load and reference the NAT helper Flavio Leitner
2019-03-26 20:57 ` [PATCH net-next 1/8] netfilter: use macros to create module aliases Flavio Leitner
2019-03-31 22:07   ` Pablo Neira Ayuso
2019-04-11 18:33     ` Flavio Leitner
2019-03-26 20:57 ` [PATCH net-next 2/8] netfilter: add API to manage NAT helpers Flavio Leitner
2019-03-31 22:10   ` Pablo Neira Ayuso
2019-04-11 18:35     ` Flavio Leitner
2019-03-31 22:12   ` Pablo Neira Ayuso
2019-03-26 20:57 ` [PATCH net-next 3/8] netfilter: nf_nat: register amanda NAT helper Flavio Leitner
2019-03-26 20:57 ` [PATCH net-next 4/8] netfilter: nf_nat: register ftp " Flavio Leitner
2019-03-26 20:57 ` Flavio Leitner [this message]
2019-03-26 20:57 ` [PATCH net-next 6/8] netfilter: nf_nat: register sip " Flavio Leitner
2019-03-26 20:57 ` [PATCH net-next 7/8] netfilter: nf_nat: register tftp " Flavio Leitner
2019-03-26 20:57 ` [PATCH net-next 8/8] openvswitch: load and reference the " Flavio Leitner
2019-03-28 23:55 ` [PATCH net-next 0/8] " David Miller
2019-03-31 20:56 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190326205715.22288-6-fbl@sysclose.org \
    --to=fbl@sysclose.org \
    --cc=dev@openvswitch.org \
    --cc=joe@ovn.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pshelar@ovn.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).