summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2016-02-27 00:32:15 -0800
committerSasha Levin <alexander.levin@verizon.com>2017-01-15 09:49:53 -0500
commit59aabf34e937d389561f5a782350cab8acd074dc (patch)
tree31a0d68c1e0282bf6610d3170a95ddff218ce3dc /include
parentbd73bf40df53c9dc493a889c3fed89924da071ac (diff)
net: ipv4: Convert IP network timestamps to be y2038 safe
[ Upstream commit 822c868532cae2cc1c51f4f18ab61c194d98aaf6 ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/ip.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index d00ebdf14ca4..7f0cd17668ae 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -233,6 +233,8 @@ static inline int inet_is_local_reserved_port(struct net *net, int port)
}
#endif
+__be32 inet_current_timestamp(void);
+
/* From inetpeer.c */
extern int inet_peer_threshold;
extern int inet_peer_minttl;