Skip to content

Commit

Permalink
sock_diag: fix autoloading of the raw_diag module
Browse files Browse the repository at this point in the history
IPPROTO_RAW isn't registred as an inet protocol, so
inet_protos[protocol] is always NULL for it.

Cc: Cyrill Gorcunov <[email protected]>
Cc: Xin Long <[email protected]>
Fixes: bf2ae2e ("sock_diag: request _diag module only when the family or proto has been registered")
Signed-off-by: Andrei Vagin <[email protected]>
Reviewed-by: Cyrill Gorcunov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
avagin authored and davem330 committed Nov 6, 2018
1 parent d016b4a commit c34c128
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c34c128

Please sign in to comment.