Thread (7 messages) 7 messages, 4 authors, 2024-02-15

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

From: Andrea Claudi <hidden>
Date: 2024-02-06 16:17:34

On Tue, Feb 06, 2024 at 09:22:06AM -0500, Stephen Gallagher wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
---
 misc/ifstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 721f4914..767cedd4 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -58,7 +58,7 @@ struct ifstat_ent {
 	struct ifstat_ent	*next;
 	char			*name;
 	int			ifindex;
-	__u64			val[MAXS];
+	unsigned long long	val[MAXS];
 	double			rate[MAXS];
 	__u32			ival[MAXS];
 };
-- 
2.43.0
Hi Stephen, thanks for taking care of this.

FYI, patch directed to iproute2 or iproute2-next tree should:
- preferrably have [PATCH iproute2] in their subject
- be directed or cc'd to iproute2 maintainers Stephen Hemminger and
  David Ahern, and to the author of the fixed commit if possible.

This should include a Fixes: line on the commit changing val to __u64:
Fixes: 5a52102b7c8f ("ifstat: Add extended statistics to ifstat")
Stephen, David: do Stephen needs to resend this?

That said, patch looks good to me, so feel free to add my reviewed-by to
the following versions of this patch.

Reviewed-by: Andrea Claudi <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help