X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/59d37c7ec5a7ce949db07d50594cca68fa724443..9aee9964aaee40750acde45f838f48eb8f95fbe3:/print-sflow.c diff --git a/print-sflow.c b/print-sflow.c index ea947ba2..ca444213 100644 --- a/print-sflow.c +++ b/print-sflow.c @@ -21,9 +21,7 @@ /* specification: https://sflow.org/developers/specifications.php */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -494,7 +492,7 @@ sflow_print_counter_records(netdissect_options *ndo, tptr = pointer; tlen = len; - while (nrecords > 0) { + while (nrecords != 0) { /* do we have the "header?" */ if (tlen < sizeof(struct sflow_counter_record_t)) return 1; @@ -683,14 +681,14 @@ sflow_print_flow_records(netdissect_options *ndo, tptr = pointer; tlen = len; - while (nrecords > 0) { + while (nrecords != 0) { /* do we have the "header?" */ if (tlen < sizeof(struct sflow_flow_record_t)) return 1; sflow_flow_record = (const struct sflow_flow_record_t *)tptr; - /* so, the funky encoding means we cannot blythly mask-off + /* so, the funky encoding means we cannot blithely mask-off bits, we must also check the enterprise. */ enterprise = GET_BE_U_4(sflow_flow_record->format); @@ -896,7 +894,7 @@ sflow_print(netdissect_options *ndo, tptr += sizeof(struct sflow_v6_datagram_t); tlen -= sizeof(struct sflow_v6_datagram_t); } - while (nsamples > 0 && tlen > 0) { + while (nsamples != 0 && tlen != 0) { sflow_sample = (const struct sflow_sample_header *)tptr; sflow_sample_type = (GET_BE_U_4(sflow_sample->format)&0x0FFF);