From 7c411484dad3e4de048df2dc37dfa66054a00392 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sat, 8 Nov 2003 06:27:05 -0800 Subject: [PATCH] [TCP]: Normalize jiffies values reported to userspace. --- net/ipv4/tcp_ipv4.c | 8 +++++--- net/ipv6/tcp_ipv6.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 46a61776ded41..558fe618276a8 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -2490,7 +2491,7 @@ static void get_openreq4(struct sock *sk, struct open_request *req, TCP_SYN_RECV, 0, 0, /* could print option size, but that is af dependent. */ 1, /* timers active (only the expire timer) */ - ttd, + jiffies_to_clock_t(ttd), req->retrans, uid, 0, /* non standard timer */ @@ -2528,7 +2529,8 @@ static void get_tcp4_sock(struct sock *sp, char *tmpbuf, int i) "%08X %5d %8d %lu %d %p %u %u %u %u %d", i, src, srcp, dest, destp, sp->sk_state, tp->write_seq - tp->snd_una, tp->rcv_nxt - tp->copied_seq, - timer_active, timer_expires - jiffies, + timer_active, + jiffies_to_clock_t(timer_expires - jiffies), tp->retransmits, sock_i_uid(sp), tp->probes_out, @@ -2556,7 +2558,7 @@ static void get_timewait4_sock(struct tcp_tw_bucket *tw, char *tmpbuf, int i) sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X" " %02X %08X:%08X %02X:%08X %08X %5d %8d %d %d %p", i, src, srcp, dest, destp, tw->tw_substate, 0, 0, - 3, ttd, 0, 0, 0, 0, + 3, jiffies_to_clock_t(ttd), 0, 0, 0, 0, atomic_read(&tw->tw_refcnt), tw); } diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0e1ca9018f8ca..623ec7c2db399 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -1941,7 +1942,7 @@ static void get_openreq6(struct seq_file *seq, TCP_SYN_RECV, 0,0, /* could print option size, but that is af dependent. */ 1, /* timers active (only the expire timer) */ - ttd, + jiffies_to_clock_t(ttd), req->retrans, uid, 0, /* non standard timer */ @@ -1987,7 +1988,8 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) dest->s6_addr32[2], dest->s6_addr32[3], destp, sp->sk_state, tp->write_seq-tp->snd_una, tp->rcv_nxt-tp->copied_seq, - timer_active, timer_expires-jiffies, + timer_active, + jiffies_to_clock_t(timer_expires - jiffies), tp->retransmits, sock_i_uid(sp), tp->probes_out, @@ -2022,7 +2024,7 @@ static void get_timewait6_sock(struct seq_file *seq, dest->s6_addr32[0], dest->s6_addr32[1], dest->s6_addr32[2], dest->s6_addr32[3], destp, tw->tw_substate, 0, 0, - 3, ttd, 0, 0, 0, 0, + 3, jiffies_to_clock_t(ttd), 0, 0, 0, 0, atomic_read(&tw->tw_refcnt), tw); } -- 2.53.0