From: Paul Wouters <pwouters@redhat.com>
To: James Morris <jmorris@namei.org>,
"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH] Fix for loading non-namespace aware ipv4 protocols without CONFIG_NAMESPACES
Date: Sun, 01 Sep 2013 15:30:26 -0400 [thread overview]
Message-ID: <522395D2.7080209@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 433 bytes --]
Attached is a trivial patch to allow inet_add_protocol on kernels without CONFIG_NAMESPACES to load non-namespace aware (out of kernel) modules.
For IPv6, there is no such check. Some discussion of that can be found in the archive: http://www.spinics.net/lists/netdev/msg225184.html
I'm ambivalent on whether the check should be there (like in ipv4) or not (like in ipv6). But if it is there, it should use the proper #ifdef.
Paul
[-- Attachment #2: ipv4-protocol-nonamespace.patch --]
[-- Type: text/x-patch, Size: 841 bytes --]
commit 9e3ddb21568284fb9061a91bbd3158909b1dec45
Author: Paul Wouters <pwouters@redhat.com>
Date: Sun Sep 1 15:18:37 2013 -0400
* Fix for loading non-namespace aware ipv4 protocols without
CONFIG_NAMESPACES set. IPv6 does not have this check.
diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
index ce84846..b5f785c 100644
--- a/net/ipv4/protocol.c
+++ b/net/ipv4/protocol.c
@@ -37,11 +37,13 @@ const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS] __read_mostly;
int inet_add_protocol(const struct net_protocol *prot, unsigned char protocol)
{
+#ifdef CONFIG_NAMESPACES
if (!prot->netns_ok) {
pr_err("Protocol %u is not namespace aware, cannot register.\n",
protocol);
return -EINVAL;
}
+#endif
return !cmpxchg((const struct net_protocol **)&inet_protos[protocol],
NULL, prot) ? 0 : -1;
reply other threads:[~2013-09-01 19:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=522395D2.7080209@redhat.com \
--to=pwouters@redhat.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=netdev@vger.kernel.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).