]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: tcp_get_info() should read tcp_time_stamp later
authorEric Dumazet <edumazet@google.com>
Thu, 16 Mar 2017 22:43:19 +0000 (15:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Mar 2017 04:37:13 +0000 (21:37 -0700)
commitf6db6f15b60aee343c916a6c06ce49a89036d07b
tree63eedb1bec5da3449c41e53e56fea4eee4f02c5e
parentd316176866cbcfe4e34996ceb0f4407785f105a8
tcp: tcp_get_info() should read tcp_time_stamp later

Commit 336d06d50089 ("tcp: make TCP_INFO more consistent") moved
lock_sock_fast() earlier in tcp_get_info()

This has the minor effect that jiffies value being sampled at the
beginning of tcp_get_info() is more likely to be off by one, and we
report big tcpi_last_data_sent values (like 0xFFFFFFFF).

Since we lock the socket, fetching tcp_time_stamp right before
doing the jiffies_to_msecs() calls is enough to remove these
wrong values.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c