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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bmb34htz.fsf@toke.dk>
Date:   Thu, 19 Jul 2018 12:53:44 +0200
From:   Toke Høiland-Jørgensen <toke@...e.dk>
To:     David Ahern <dsahern@...il.com>, netdev@...r.kernel.org
Cc:     cake@...ts.bufferbloat.net, Dave Taht <dave.taht@...il.com>
Subject: Re: [PATCH iproute2-next v10] Add support for CAKE qdisc

A few comments below; will fix the rest.

>> +			print_uint(PRINT_JSON, "bandwidth", NULL, bandwidth);
>> +			print_string(PRINT_FP, NULL, "bandwidth %s ", sprint_rate(bandwidth, b1));
>> +		} else
>> +			print_string(PRINT_ANY, "bandwidth", "bandwidth %s ", "unlimited");
>> +	}
>> +	if (tb[TCA_CAKE_AUTORATE] &&
>> +		RTA_PAYLOAD(tb[TCA_CAKE_AUTORATE]) >= sizeof(__u32)) {
>> +		autorate = rta_getattr_u32(tb[TCA_CAKE_AUTORATE]);
>> +		if(autorate == 1)
>> +			print_string(PRINT_ANY, "autorate", "autorate_%s ", "ingress");
>> +		else if(autorate)
>> +			print_string(PRINT_ANY, "autorate", "(?autorate?) ", "unknown");
>
> Why the '(?' and '?)'? here and the diffserv below.

The (? ?) indicates that a value was present, but it was not understood
by tc. This has been quite useful to discover mismatch between kernel
and userspace versions of CAKE as we have been developing it.

>> +	}
>> +
>> +	if (tb[TCA_CAKE_NAT] &&
>> +	    RTA_PAYLOAD(tb[TCA_CAKE_NAT]) >= sizeof(__u32)) {
>> +	    nat = rta_getattr_u32(tb[TCA_CAKE_NAT]);
>> +	}
>> +
>> +	if(nat)
>> +		print_string(PRINT_FP, NULL, "nat ", NULL);
>> +	print_bool(PRINT_JSON, "nat", NULL, nat);
>
> why is the fp print under the if check but the json one is not? you
> have this in a number of places. Why not be consistent in the output?

Because JSON can actually express booleans properly, and thus we can be
explicit about its value instead of just omitting it.



-Toke

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ