From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrei Vagin Subject: [PATCH] sock_diag: fix autoloading of the raw_diag module Date: Sun, 4 Nov 2018 22:37:15 -0800 Message-ID: <20181105063715.21639-1-avagin@gmail.com> Cc: netdev@vger.kernel.org, Andrei Vagin , Cyrill Gorcunov , Xin Long To: "David S. Miller" Return-path: Received: from mail-pl1-f193.google.com ([209.85.214.193]:43421 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729398AbeKEPzZ (ORCPT ); Mon, 5 Nov 2018 10:55:25 -0500 Received: by mail-pl1-f193.google.com with SMTP id g59-v6so3935386plb.10 for ; Sun, 04 Nov 2018 22:37:19 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: IPPROTO_TCP isn't registred as an inet protocol, so inet_protos[protocol] is always NULL for it. Cc: Cyrill Gorcunov Cc: Xin Long Fixes: bf2ae2e4bf93 ("sock_diag: request _diag module only when the family or proto has been registered") Signed-off-by: Andrei Vagin --- 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