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: <20200708233305.07b53f8a@hermes.lan>
Date:   Wed, 8 Jul 2020 23:33:05 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     "YU, Xiangning" <xiangning.yu@...baba-inc.com>
Cc:     Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH iproute2-next v2] iproute2 Support lockless token bucket
 (ltb)

On Thu, 09 Jul 2020 00:38:27 +0800
"YU, Xiangning" <xiangning.yu@...baba-inc.com> wrote:

> +static int ltb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
> +			       struct nlmsghdr *n, const char *dev)
> +{
> +	struct tc_ltb_opt opt;

If you use empty initializer in C it will make everything 0 and save you some pain.

	struct tc_ltb_opt opt = { };


> +		fprintf(f, "rate %s ", sprint_rate(rate64, b1));
> +		fprintf(f, "ceil %s ", sprint_rate(ceil64, b1));
> +		if (show_details) {
> +			fprintf(f, "measured %llu allocated %llu highwater %llu",
> +				lopt->measured, lopt->allocated,
> +				lopt->high_water);


All output has to be in JSON. Any use of fprintf(f, ...) directly
is a indication to me of code that is not supporting JSON correctly.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ