Thread (5 messages) 5 messages, 3 authors, 2016-08-12

Re: [iproute PATCH] ip-route: Pretty-print expired routes

flat view

From: Edward Cree <hidden>
Date: 2016-08-11 13:46:39

On 10/08/16 12:14, Phil Sutter wrote:
quoted hunk ↗ jump to hunk
Instead of printing 'expires -23sec' for expired (but not yet garbage
collected) routes, print 'expired 23sec' instead.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 ip/iproute.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index c52294d298210..a89a26d68be0f 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -305,6 +305,14 @@ static void print_rtax_features(FILE *fp, unsigned int features)
 		fprintf(fp, " 0x%x", of);
 }
 
+static void print_expires(FILE *fp, __s32 expires, int hz)
+{
+	if (expires > 0)
+		fprintf(fp, " expires %dsec", expires/hz);
+	else
+		fprintf(fp, " expired %dsec", -expires/hz);
+}
Perhaps something that differs by more than a single character, to
make it stand out more?  I don't know what to suggest, though.

-Ed
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help