From: Andrei Vagin <avagin@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Andrei Vagin <avagin@gmail.com>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Xin Long <lucien.xin@gmail.com>
Subject: [PATCH] sock_diag: fix autoloading of the raw_diag module
Date: Sun, 4 Nov 2018 22:37:15 -0800 [thread overview]
Message-ID: <20181105063715.21639-1-avagin@gmail.com> (raw)
IPPROTO_TCP isn't registred as an inet protocol, so
inet_protos[protocol] is always NULL for it.
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Xin Long <lucien.xin@gmail.com>
Fixes: bf2ae2e4bf93 ("sock_diag: request _diag module only when the family or proto has been registered")
Signed-off-by: Andrei Vagin <avagin@gmail.com>
---
net/core/sock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/core/sock.c b/net/core/sock.c
index 6fcc4bc07d19..080a880a1761 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3279,6 +3279,7 @@ int sock_load_diag_module(int family, int protocol)
#ifdef CONFIG_INET
if (family == AF_INET &&
+ protocol != IPPROTO_RAW &&
!rcu_access_pointer(inet_protos[protocol]))
return -ENOENT;
#endif
--
2.17.2
next reply other threads:[~2018-11-05 15:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 6:37 Andrei Vagin [this message]
2018-11-05 7:12 ` [PATCH] sock_diag: fix autoloading of the raw_diag module Cyrill Gorcunov
2018-11-05 18:22 ` Cyrill Gorcunov
2018-11-06 1:10 ` 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=20181105063715.21639-1-avagin@gmail.com \
--to=avagin@gmail.com \
--cc=davem@davemloft.net \
--cc=gorcunov@gmail.com \
--cc=lucien.xin@gmail.com \
--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).