]> git.baikalelectronics.ru Git - kernel.git/commit
net-timestamp: only report sw timestamp if reporting bit is set
authorWillem de Bruijn <willemb@google.com>
Wed, 3 Sep 2014 16:01:18 +0000 (12:01 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Sep 2014 22:02:43 +0000 (15:02 -0700)
commit0ff775575cf8ad55d6db6208736d6a5459d3baa1
treeb268f9b6beba39274edf9b250ea3cfe22bebe25a
parent93cd8b659db3ab3dee7fc4b345ca08de06576d0a
net-timestamp: only report sw timestamp if reporting bit is set

The timestamping API has separate bits for generating and reporting
timestamps. A software timestamp should only be reported for a packet
when the packet has the relevant generation flag (SKBTX_..) set
and the socket has reporting bit SOF_TIMESTAMPING_SOFTWARE set.

The second check was accidentally removed. Reinstitute the original
behavior.

Tested:
  Without this patch, Documentation/networking/txtimestamp reports
  timestamps regardless of whether SOF_TIMESTAMPING_SOFTWARE is set.
  After the patch, it only reports them when the flag is set.

Fixes: 742c80fcd6ec ("net-timestamp: extend SCM_TIMESTAMPING ancillary data struct")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/socket.c