]> git.baikalelectronics.ru Git - kernel.git/commit
net: packetmmap: fix only tx timestamp on request
authorRichard Sanger <rsanger@wand.net.nz>
Wed, 12 May 2021 01:31:22 +0000 (13:31 +1200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 May 2021 21:00:04 +0000 (14:00 -0700)
commit0eb61e918ae593b33c72b7659e3c151fcd4229f4
treea5494bf5a8fd4b915b18cb0a233a7920d4f3b108
parentcb799a1df47b696460f56905fd9f4b38f509f727
net: packetmmap: fix only tx timestamp on request

The packetmmap tx ring should only return timestamps if requested via
setsockopt PACKET_TIMESTAMP, as documented. This allows compatibility
with non-timestamp aware user-space code which checks
tp_status == TP_STATUS_AVAILABLE; not expecting additional timestamp
flags to be set in tp_status.

Fixes: 00ef36ae9a87 ("packet: if hw/sw ts enabled in rx/tx ring, report which ts we got")
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: Richard Sanger <rsanger@wand.net.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c