aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2016-02-27 03:32:17 -0500
committerDavid S. Miller <davem@davemloft.net>2016-03-01 17:18:44 -0500
commit6497c7e6400105424a7d1dddc3f3aadcc8e3588a (patch)
tree995d717d35294cc0bac130b78949d2bbf00d49ab
parentb1b270d863c022f3dbf1f8786fd2956703ee10fc (diff)
net: sctp: Convert log timestamps to be y2038 safe
SCTP probe log timestamps use struct timespec which is not y2038 safe. Use struct timespec64 which is 2038 safe instead. Use monotonic time instead of real time as only time differences are logged. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Neil Horman <nhorman@tuxdriver.com> Cc: Vlad Yasevich <vyasevich@gmail.com> Cc: Neil Horman <nhorman@tuxdriver.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-sctp@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sctp/probe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sctp/probe.c b/net/sctp/probe.c
index 5e68b94ee640..6cc2152e0740 100644
--- a/net/sctp/probe.c
+++ b/net/sctp/probe.c
@@ -65,7 +65,7 @@ static struct {
65 struct kfifo fifo; 65 struct kfifo fifo;
66 spinlock_t lock; 66 spinlock_t lock;
67 wait_queue_head_t wait; 67 wait_queue_head_t wait;
68 struct timespec tstart; 68 struct timespec64 tstart;
69} sctpw; 69} sctpw;
70 70
71static __printf(1, 2) void printl(const char *fmt, ...) 71static __printf(1, 2) void printl(const char *fmt, ...)
@@ -85,7 +85,7 @@ static __printf(1, 2) void printl(const char *fmt, ...)
85static int sctpprobe_open(struct inode *inode, struct file *file) 85static int sctpprobe_open(struct inode *inode, struct file *file)
86{ 86{
87 kfifo_reset(&sctpw.fifo); 87 kfifo_reset(&sctpw.fifo);
88 getnstimeofday(&sctpw.tstart); 88 ktime_get_ts64(&sctpw.tstart);
89 89
90 return 0; 90 return 0;
91} 91}
@@ -138,7 +138,7 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
138 struct sk_buff *skb = chunk->skb; 138 struct sk_buff *skb = chunk->skb;
139 struct sctp_transport *sp; 139 struct sctp_transport *sp;
140 static __u32 lcwnd = 0; 140 static __u32 lcwnd = 0;
141 struct timespec now; 141 struct timespec64 now;
142 142
143 sp = asoc->peer.primary_path; 143 sp = asoc->peer.primary_path;
144 144
@@ -149,8 +149,8 @@ static sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
149 (full || sp->cwnd != lcwnd)) { 149 (full || sp->cwnd != lcwnd)) {
150 lcwnd = sp->cwnd; 150 lcwnd = sp->cwnd;
151 151
152 getnstimeofday(&now); 152 ktime_get_ts64(&now);
153 now = timespec_sub(now, sctpw.tstart); 153 now = timespec64_sub(now, sctpw.tstart);
154 154
155 printl("%lu.%06lu ", (unsigned long) now.tv_sec, 155 printl("%lu.%06lu ", (unsigned long) now.tv_sec,
156 (unsigned long) now.tv_nsec / NSEC_PER_USEC); 156 (unsigned long) now.tv_nsec / NSEC_PER_USEC);