summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@gmail.com>2018-11-05 07:37:15 +0100
committerDavid S. Miller <davem@davemloft.net>2018-11-06 02:09:19 +0100
commitc34c1287778b080ed692c0a46a8e345206cc29e6 (patch)
tree360fae225ac0505ee880a8b7d4b82295c9d94d22 /net/core
parentnet: core: netpoll: Enable netconsole IPv6 link local address (diff)
downloadlinux-c34c1287778b080ed692c0a46a8e345206cc29e6.tar.xz
linux-c34c1287778b080ed692c0a46a8e345206cc29e6.zip
sock_diag: fix autoloading of the raw_diag module
IPPROTO_RAW 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> Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sock.c1
1 files changed, 1 insertions, 0 deletions
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