Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sock_diag: add module pointer to "struct sock_diag_handler"

Following patch is going to use RCU instead of
sock_diag_table_mutex acquisition.

This patch is a preparation, no change of behavior yet.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
114b4bb1 223f5519

+10
+1
include/linux/sock_diag.h
··· 13 13 struct sock; 14 14 15 15 struct sock_diag_handler { 16 + struct module *owner; 16 17 __u8 family; 17 18 int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh); 18 19 int (*get_info)(struct sk_buff *skb, struct sock *sk);
+2
net/ipv4/inet_diag.c
··· 1488 1488 } 1489 1489 1490 1490 static const struct sock_diag_handler inet_diag_handler = { 1491 + .owner = THIS_MODULE, 1491 1492 .family = AF_INET, 1492 1493 .dump = inet_diag_handler_cmd, 1493 1494 .get_info = inet_diag_handler_get_info, ··· 1496 1495 }; 1497 1496 1498 1497 static const struct sock_diag_handler inet6_diag_handler = { 1498 + .owner = THIS_MODULE, 1499 1499 .family = AF_INET6, 1500 1500 .dump = inet_diag_handler_cmd, 1501 1501 .get_info = inet_diag_handler_get_info,
+1
net/netlink/diag.c
··· 241 241 } 242 242 243 243 static const struct sock_diag_handler netlink_diag_handler = { 244 + .owner = THIS_MODULE, 244 245 .family = AF_NETLINK, 245 246 .dump = netlink_diag_handler_dump, 246 247 };
+1
net/packet/diag.c
··· 245 245 } 246 246 247 247 static const struct sock_diag_handler packet_diag_handler = { 248 + .owner = THIS_MODULE, 248 249 .family = AF_PACKET, 249 250 .dump = packet_diag_handler_dump, 250 251 };
+1
net/smc/smc_diag.c
··· 255 255 } 256 256 257 257 static const struct sock_diag_handler smc_diag_handler = { 258 + .owner = THIS_MODULE, 258 259 .family = AF_SMC, 259 260 .dump = smc_diag_handler_dump, 260 261 };
+1
net/tipc/diag.c
··· 95 95 } 96 96 97 97 static const struct sock_diag_handler tipc_sock_diag_handler = { 98 + .owner = THIS_MODULE, 98 99 .family = AF_TIPC, 99 100 .dump = tipc_sock_diag_handler_dump, 100 101 };
+1
net/unix/diag.c
··· 322 322 } 323 323 324 324 static const struct sock_diag_handler unix_diag_handler = { 325 + .owner = THIS_MODULE, 325 326 .family = AF_UNIX, 326 327 .dump = unix_diag_handler_dump, 327 328 };
+1
net/vmw_vsock/diag.c
··· 157 157 } 158 158 159 159 static const struct sock_diag_handler vsock_diag_handler = { 160 + .owner = THIS_MODULE, 160 161 .family = AF_VSOCK, 161 162 .dump = vsock_diag_handler_dump, 162 163 };
+1
net/xdp/xsk_diag.c
··· 194 194 } 195 195 196 196 static const struct sock_diag_handler xsk_diag_handler = { 197 + .owner = THIS_MODULE, 197 198 .family = AF_XDP, 198 199 .dump = xsk_diag_handler_dump, 199 200 };