|
|
36cfb7 |
From ca6a2e6f21fc48b494216a095f5bd792a0c6e35d Mon Sep 17 00:00:00 2001
|
|
|
36cfb7 |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
36cfb7 |
Date: Mon, 29 Apr 2019 20:08:08 +0200
|
|
|
36cfb7 |
Subject: [PATCH] ss: Make struct tcpstat fields 'timer' and 'timeout' unsigned
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
|
|
|
36cfb7 |
Upstream Status: iproute2.git commit 4cbf5224f2b50
|
|
|
36cfb7 |
|
|
|
36cfb7 |
commit 4cbf5224f2b50a24e1873508e7a0f1f81cc81a81
|
|
|
36cfb7 |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
36cfb7 |
Date: Thu Aug 24 11:41:26 2017 +0200
|
|
|
36cfb7 |
|
|
|
36cfb7 |
ss: Make struct tcpstat fields 'timer' and 'timeout' unsigned
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Both 'timer' and 'timeout' variables of struct tcpstat are either
|
|
|
36cfb7 |
scanned as unsigned values from /proc/net/tcp{,6} or copied from
|
|
|
36cfb7 |
'idiag_timer' and 'idiag_expries' fields of struct inet_diag_msg, which
|
|
|
36cfb7 |
itself are unsigned. Therefore they may be unsigned as well, which
|
|
|
36cfb7 |
eliminates the need to check for negative values.
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
36cfb7 |
---
|
|
|
36cfb7 |
misc/ss.c | 8 +++-----
|
|
|
36cfb7 |
1 file changed, 3 insertions(+), 5 deletions(-)
|
|
|
36cfb7 |
|
|
|
36cfb7 |
diff --git a/misc/ss.c b/misc/ss.c
|
|
|
36cfb7 |
index 7a38e9d830e8d..2a981d8b06918 100644
|
|
|
36cfb7 |
--- a/misc/ss.c
|
|
|
36cfb7 |
+++ b/misc/ss.c
|
|
|
36cfb7 |
@@ -716,8 +716,8 @@ struct dctcpstat {
|
|
|
36cfb7 |
|
|
|
36cfb7 |
struct tcpstat {
|
|
|
36cfb7 |
struct sockstat ss;
|
|
|
36cfb7 |
- int timer;
|
|
|
36cfb7 |
- int timeout;
|
|
|
36cfb7 |
+ unsigned int timer;
|
|
|
36cfb7 |
+ unsigned int timeout;
|
|
|
36cfb7 |
int probes;
|
|
|
36cfb7 |
char cong_alg[16];
|
|
|
36cfb7 |
double rto, ato, rtt, rttvar;
|
|
|
36cfb7 |
@@ -903,13 +903,11 @@ static void sock_addr_print(const char *addr, char *delim, const char *port,
|
|
|
36cfb7 |
sock_addr_print_width(addr_width, addr, delim, serv_width, port, ifname);
|
|
|
36cfb7 |
}
|
|
|
36cfb7 |
|
|
|
36cfb7 |
-static const char *print_ms_timer(int timeout)
|
|
|
36cfb7 |
+static const char *print_ms_timer(unsigned int timeout)
|
|
|
36cfb7 |
{
|
|
|
36cfb7 |
static char buf[64];
|
|
|
36cfb7 |
int secs, msecs, minutes;
|
|
|
36cfb7 |
|
|
|
36cfb7 |
- if (timeout < 0)
|
|
|
36cfb7 |
- timeout = 0;
|
|
|
36cfb7 |
secs = timeout/1000;
|
|
|
36cfb7 |
minutes = secs/60;
|
|
|
36cfb7 |
secs = secs%60;
|
|
|
36cfb7 |
--
|
|
|
e138d9 |
2.21.0
|
|
|
36cfb7 |
|