summaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorWillem de Bruijn2014-09-03 18:01:18 +0200
committerDavid S. Miller2014-09-06 00:02:43 +0200
commitc199105d154e029cd8c94cccd35bd073e64acc45 (patch)
treeb268f9b6beba39274edf9b250ea3cfe22bebe25a /net/socket.c
parentdrivers/net/fddi/skfp/h/skfbi.h: Remove useless PCI_BASE_2ND macros (diff)
downloadkernel-qcow2-linux-c199105d154e029cd8c94cccd35bd073e64acc45.tar.gz
kernel-qcow2-linux-c199105d154e029cd8c94cccd35bd073e64acc45.tar.xz
kernel-qcow2-linux-c199105d154e029cd8c94cccd35bd073e64acc45.zip
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: f24b9be5957b ("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>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c
index 95ee7d8682e7..4eb09b34b2d3 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -734,8 +734,7 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
}
memset(&tss, 0, sizeof(tss));
- if ((sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE ||
- skb_shinfo(skb)->tx_flags & SKBTX_ANY_SW_TSTAMP) &&
+ if ((sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE) &&
ktime_to_timespec_cond(skb->tstamp, tss.ts + 0))
empty = 0;
if (shhwtstamps &&