summaryrefslogtreecommitdiff
path: root/net/packet/diag.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-03-16 01:10:11 +0000
committerDavid S. Miller <davem@davemloft.net>2023-03-17 08:52:05 +0000
commit164bddace2e03f6005e650cb88f101a66ebdc05a (patch)
tree862fb745ff1aa864b0f0b3f46d2b39f6c8bd1f48 /net/packet/diag.c
parent7438344660fa55b33b8234c1797c886eb73667a7 (diff)
net/packet: convert po->tp_loss to an atomic flag
tp_loss can be read locklessly. Convert it to an atomic flag to avoid races. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/diag.c')
-rw-r--r--net/packet/diag.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/diag.c b/net/packet/diag.c
index 0abca32e2f87..8bb4ce6a8e61 100644
--- a/net/packet/diag.c
+++ b/net/packet/diag.c
@@ -29,7 +29,7 @@ static int pdiag_put_info(const struct packet_sock *po, struct sk_buff *nlskb)
pinfo.pdi_flags |= PDI_ORIGDEV;
if (po->has_vnet_hdr)
pinfo.pdi_flags |= PDI_VNETHDR;
- if (po->tp_loss)
+ if (packet_sock_flag(po, PACKET_SOCK_TP_LOSS))
pinfo.pdi_flags |= PDI_LOSS;
return nla_put(nlskb, PACKET_DIAG_INFO, sizeof(pinfo), &pinfo);