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: <aEWc81vmd3kr57XP@shredder>
Date: Sun, 8 Jun 2025 17:23:47 +0300
From: Ido Schimmel <idosch@...dia.com>
To: Petr Machata <petrm@...dia.com>
Cc: David Ahern <dsahern@...il.com>, netdev@...r.kernel.org,
	Nikolay Aleksandrov <razor@...ckwall.org>
Subject: Re: [PATCH iproute2-next 1/4] ip: ipstats: Iterate all xstats
 attributes

On Fri, Jun 06, 2025 at 05:04:50PM +0200, Petr Machata wrote:
> @@ -600,15 +601,14 @@ int ipstats_stat_desc_show_xstats(struct ipstats_stat_show_attrs *attrs,
>  	if (at == NULL)
>  		return err;
>  
> -	tb = alloca(sizeof(*tb) * (xdesc->inner_max + 1));
> -	err = parse_rtattr_nested(tb, xdesc->inner_max, at);
> -	if (err != 0)
> -		return err;
> -
> -	if (tb[xdesc->inner_at] != NULL) {
> -		print_nl();
> -		xdesc->show_cb(tb[xdesc->inner_at]);
> +	rem = RTA_PAYLOAD(at);
> +	for (i = RTA_DATA(at); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) {

Use rtattr_for_each_nested() ?

> +		if (i->rta_type == xdesc->inner_at) {
> +			print_nl();
> +			xdesc->show_cb(i);
> +		}
>  	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.49.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ