Subject: Re: [PATCH] iproute2: fix type incompatibility in ifstat.c

From: Stephen Hemminger <[email-masked]>
Date: Tue, 6 Feb 2024 19:12:09 -0800

On Tue,  6 Feb 2024 09:22:06 -0500
Stephen Gallagher <[email-masked]> wrote:

> Throughout ifstat.c, ifstat_ent.val is accessed as a long long unsigned
> type, however it is defined as __u64. This works by coincidence on many
> systems, however on ppc64le, __u64 is a long unsigned.
> 
> This patch makes the type definition consistent with all of the places
> where it is accessed.
> 
> Signed-off-by: Stephen Gallagher <[email-masked]>
> ---

Why not fix the use of unsigned long long to be __u64 instead?
That would make more sense.

Looking at ifstat it has other problems.
It doesn't check the sizes in the netlink response.

It really should be using 64 bit stat counters, not the legacy 32 bit
values. (ie IFLA_STATS64). Anyone want to take this on?X

Also, the cpu_hits offload code is a wart. If it is of interest, it should
be more than one stat.

One last issue, is that change the size of this structure will break old
history files.