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]
Date:   Wed, 27 Mar 2019 07:53:57 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Leslie Monis <lesliemonis@...il.com>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 1/2] tc: pie: change maximum integer value of
 tc_pie_xstats->prob

On Sun, 24 Mar 2019 00:18:34 +0530
Leslie Monis <lesliemonis@...il.com> wrote:

> tc_pie_xstats->prob has a maximum value of (2^64 - 1).
> 
> Signed-off-by: Leslie Monis <lesliemonis@...il.com>
> ---
>  tc/q_pie.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tc/q_pie.c b/tc/q_pie.c
> index f7924ef5..6566ca10 100644
> --- a/tc/q_pie.c
> +++ b/tc/q_pie.c
> @@ -198,7 +198,7 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f,
>  	st = RTA_DATA(xstats);
>  	/*prob is returned as a fracion of maximum integer value */
>  	fprintf(f, "prob %f delay %uus avg_dq_rate %u\n",
> -		(double)st->prob / (double)0xffffffff, st->delay,
> +		(double)st->prob / (double)0xffffffffffffffff, st->delay,

This won't work correctly on 32bit systems because that value won't fit there.. You would be better off using UINT64_MAX

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ