]> The Tcpdump Group git mirrors - tcpdump/commitdiff
The ifSpeed field of a generic interface counter in sFlow is 64 bits.
authorRick Jones <[email protected]>
Thu, 2 Jun 2011 17:56:08 +0000 (10:56 -0700)
committerGuy Harris <[email protected]>
Thu, 2 Jun 2011 17:56:08 +0000 (10:56 -0700)
The "overlay" definition in print-sflow.c is correct, but the actual
extract for printing is using EXTRACT_32BITS rather than EXTRACT_64BITS,
which leads to an incorrect report for speed.

Reviewed-By: Guy Harris <[email protected]>
print-sflow.c

index f27370a456e9d33dcaecd383f5192acf01254b69..79a3fdf1d9c7ea4297390a6f37e975e06fb60b8c 100644 (file)
@@ -313,10 +313,10 @@ print_sflow_counter_generic(const u_char *pointer, u_int len) {
 
 
     sflow_gen_counter = (const struct sflow_generic_counter_t *)pointer;
-    printf("\n\t      ifindex %u, iftype %u, ifspeed %u, ifdirection %u (%s)",
+    printf("\n\t      ifindex %u, iftype %u, ifspeed %" PRIu64 ", ifdirection %u (%s)",
           EXTRACT_32BITS(sflow_gen_counter->ifindex),
           EXTRACT_32BITS(sflow_gen_counter->iftype),
-          EXTRACT_32BITS(sflow_gen_counter->ifspeed),
+          EXTRACT_64BITS(sflow_gen_counter->ifspeed),
           EXTRACT_32BITS(sflow_gen_counter->ifdirection),
           tok2str(sflow_iface_direction_values, "Unknown",
                   EXTRACT_32BITS(sflow_gen_counter->ifdirection)));