Skip to contentSkip to conversation

ifstat.c: fix type incompatibility

PATCH In review Stephen Gallagher 1 participant 2 messages Feb 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ifstat.c: fix type incompatibility

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.

---
 misc/ifstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
misc/ifstat.c +1 -1
index 721f4914..767cedd4 100644
@@ -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];
 };
Signature · 1 line
2.43.0
#1 lore raw

Please disregard; I titled this wrong. Please see "[PATCH] iproute2:
fix type incompatibility in ifstat.c" instead.

Quoted 29 lines · Stephen Gallagher

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.

---
 misc/ifstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
misc/ifstat.c +1 -2
index 721f4914..767cedd4 100644
@@ -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