]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv4: Convert IP network timestamps to be y2038 safe
authorDeepa Dinamani <deepa.kernel@gmail.com>
Sat, 27 Feb 2016 08:32:15 +0000 (00:32 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Mar 2016 22:18:44 +0000 (17:18 -0500)
commit820dccf7796f1f486dffb41b8308240e74e2b2ee
tree64639790feb5345973a58d66bd621c3d69ac3b0d
parentb6d6f2929e05ffbe1599f900aa4c155c7f66a052
net: ipv4: Convert IP network timestamps to be y2038 safe

ICMP timestamp messages and IP source route options require
timestamps to be in milliseconds modulo 24 hours from
midnight UT format.

Add inet_current_timestamp() function to support this. The function
returns the required timestamp in network byte order.

Timestamp calculation is also changed to call ktime_get_real_ts64()
which uses struct timespec64. struct timespec64 is y2038 safe.
Previously it called getnstimeofday() which uses struct timespec.
struct timespec is not y2038 safe.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: James Morris <jmorris@namei.org>
Cc: Patrick McHardy <kaber@trash.net>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip.h
net/ipv4/af_inet.c
net/ipv4/icmp.c
net/ipv4/ip_options.c