Skip to content

Commit 96c2a76

Browse files
Rick Jonesguyharris
Rick Jones
authored andcommitted
The ifSpeed field of a generic interface counter in sFlow is 64 bits.
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]>
1 parent 017bac5 commit 96c2a76

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

print-sflow.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@ print_sflow_counter_generic(const u_char *pointer, u_int len) {
313313

314314

315315
sflow_gen_counter = (const struct sflow_generic_counter_t *)pointer;
316-
printf("\n\t ifindex %u, iftype %u, ifspeed %u, ifdirection %u (%s)",
316+
printf("\n\t ifindex %u, iftype %u, ifspeed %" PRIu64 ", ifdirection %u (%s)",
317317
EXTRACT_32BITS(sflow_gen_counter->ifindex),
318318
EXTRACT_32BITS(sflow_gen_counter->iftype),
319-
EXTRACT_32BITS(sflow_gen_counter->ifspeed),
319+
EXTRACT_64BITS(sflow_gen_counter->ifspeed),
320320
EXTRACT_32BITS(sflow_gen_counter->ifdirection),
321321
tok2str(sflow_iface_direction_values, "Unknown",
322322
EXTRACT_32BITS(sflow_gen_counter->ifdirection)));

0 commit comments

Comments
 (0)