]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: ipstats: Iterate all xstats attributes
authorPetr Machata <petrm@nvidia.com>
Tue, 10 Jun 2025 15:51:24 +0000 (17:51 +0200)
committerDavid Ahern <dsahern@kernel.org>
Mon, 16 Jun 2025 02:14:07 +0000 (02:14 +0000)
commitd29538eb7ef553ff72dd766cebfe0eeaf5881538
treeffc18c4582e23d1425b147208ffe229d263bcd3f
parent98c04e53cb3e44feb2c4f2543e02801819d825fb
ip: ipstats: Iterate all xstats attributes

ipstats_stat_desc_show_xstats() operates by first parsing the attribute
stream into a type-indexed table, and then accessing the right attribute.
But bridge VLAN stats are given as several BRIDGE_XSTATS_VLAN attributes,
one per VLAN. With the above approach to parsing, only one of these
attributes would be shown. Instead, iterate the stream of attributes and
call the show_cb for each one with a matching type.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ipstats.c