lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d72b7ace0712201824k3754962cse377256cb5452b8a@mail.gmail.com>
Date:	Fri, 21 Dec 2007 11:24:54 +0900
From:	"Satoru SATOH" <satoru.satoh@...il.com>
To:	netdev@...r.kernel.org
Subject: Re: [PATCH] [IPROUTE]: A workaround to make larger rto_min printed correctly

2007/12/21, Jarek Poplawski <jarkao2@...il.com>:
> Jarek Poplawski wrote, On 12/20/2007 09:24 PM:
> ...
>
> > but since it's your patch, I hope you do some additional checking
> > if it's always like this...
>
>
> ...or maybe only changing this all a little bit will make it look safer!
>
> Jarek P.


OK, how about this?

Signed-off-by: Satoru SATOH <satoru.satoh@...il.com>

 ip/iproute.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ip/iproute.c b/ip/iproute.c
index f4200ae..c771b34 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -510,16 +510,20 @@ int print_route(const struct sockaddr_nl *who,
struct nlmsghdr *n, void *arg)
 				fprintf(fp, " %u", *(unsigned*)RTA_DATA(mxrta[i]));
 			else {
 				unsigned val = *(unsigned*)RTA_DATA(mxrta[i]);
+				unsigned hz1 = hz;
+				if (hz1 > 1000)
+					hz1 /= 1000;
+				else
+					val *= 1000;

-				val *= 1000;
 				if (i == RTAX_RTT)
 					val /= 8;
 				else if (i == RTAX_RTTVAR)
 					val /= 4;
-				if (val >= hz)
-					fprintf(fp, " %ums", val/hz);
+				if (val >= hz1)
+					fprintf(fp, " %ums", val/hz1);
 				else
-					fprintf(fp, " %.2fms", (float)val/hz);
+					fprintf(fp, " %.2fms", (float)val/hz1);
 			}
 		}
 	}


Thanks,
Satoru SATOH
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ