diff options
author | Juntong Deng <juntong.deng@outlook.com> | 2024-03-08 14:06:36 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-11 23:52:05 +0100 |
commit | 76839e2f1fded42382ac7bad215cd9e9c293e97d (patch) | |
tree | d943720ab7258ab3a0cee0ebbe38fbcc3f3e0358 /net/packet/diag.c | |
parent | net/netlink: Add getsockopt support for NETLINK_LISTEN_ALL_NSID (diff) | |
download | linux-76839e2f1fded42382ac7bad215cd9e9c293e97d.tar.xz linux-76839e2f1fded42382ac7bad215cd9e9c293e97d.zip |
net/packet: Add getsockopt support for PACKET_COPY_THRESH
Currently getsockopt does not support PACKET_COPY_THRESH,
and we are unable to get the value of PACKET_COPY_THRESH
socket option through getsockopt.
This patch adds getsockopt support for PACKET_COPY_THRESH.
In addition, this patch converts access to copy_thresh to
READ_ONCE/WRITE_ONCE.
Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://lore.kernel.org/r/AM6PR03MB58487A9704FD150CF76F542899272@AM6PR03MB5848.eurprd03.prod.outlook.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | net/packet/diag.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/diag.c b/net/packet/diag.c index b3bd2f6c2bf7..47f69f3dbf73 100644 --- a/net/packet/diag.c +++ b/net/packet/diag.c @@ -17,7 +17,7 @@ static int pdiag_put_info(const struct packet_sock *po, struct sk_buff *nlskb) pinfo.pdi_index = po->ifindex; pinfo.pdi_version = po->tp_version; pinfo.pdi_reserve = po->tp_reserve; - pinfo.pdi_copy_thresh = po->copy_thresh; + pinfo.pdi_copy_thresh = READ_ONCE(po->copy_thresh); pinfo.pdi_tstamp = READ_ONCE(po->tp_tstamp); pinfo.pdi_flags = 0; |