From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: [nf PATCH RFC] net: nf_tables: Support auto-loading inet family nat chain
Date: Wed, 17 Jul 2019 19:17:43 +0200 [thread overview]
Message-ID: <20190717171743.14754-1-phil@nwl.cc> (raw)
Trying to create an inet family nat chain would not cause
nft_chain_nat.ko module auto-load due to missing module alias.
The family is actually NFPROTO_INET which happens to be the same
numerical value as AF_UNIX.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
This is obviously a hack to illustrate the problem and show a working
solution. I'm not sure what a real fix would look like - maybe nf_tables
should internally use NFPROTO_* defines instead of AF_* ones? Maybe it
should translate NFPROTO_INET into AF_UNSPEC?
---
net/netfilter/nft_chain_nat.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netfilter/nft_chain_nat.c b/net/netfilter/nft_chain_nat.c
index 2f89bde3c61cb..d3bf4a297c655 100644
--- a/net/netfilter/nft_chain_nat.c
+++ b/net/netfilter/nft_chain_nat.c
@@ -142,3 +142,6 @@ MODULE_ALIAS_NFT_CHAIN(AF_INET, "nat");
#ifdef CONFIG_NF_TABLES_IPV6
MODULE_ALIAS_NFT_CHAIN(AF_INET6, "nat");
#endif
+#ifdef CONFIG_NF_TABLES_INET
+MODULE_ALIAS_NFT_CHAIN(AF_UNIX, "nat");
+#endif
--
2.22.0
next reply other threads:[~2019-07-17 17:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-17 17:17 Phil Sutter [this message]
2019-07-17 18:35 ` [nf PATCH RFC] net: nf_tables: Support auto-loading inet family nat chain Pablo Neira Ayuso
2019-07-17 20:11 ` Phil Sutter
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=20190717171743.14754-1-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).