Skip to content

Commit

Permalink
For unicasts counter, only subtract mcasts/bcasts when read from /pro…
Browse files Browse the repository at this point in the history
…c/net/dev
  • Loading branch information
sflow committed Sep 20, 2019
1 parent b8daf08 commit ab1a8b5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Linux/readPackets.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,23 @@ extern "C" {
// more detailed counters may have been found via ethtool or equivalent:
if(adaptorNIO->et_found & HSP_ETCTR_MC_IN) {
mcasts_in = (uint32_t)adaptorNIO->et_total.mcasts_in;
pkts_in -= mcasts_in;
if(adaptorNIO->procNetDev)
pkts_in -= mcasts_in;
}
if(adaptorNIO->et_found & HSP_ETCTR_BC_IN) {
bcasts_in = (uint32_t)adaptorNIO->et_total.bcasts_in;
pkts_in -= bcasts_in;
if(adaptorNIO->procNetDev)
pkts_in -= bcasts_in;
}
if(adaptorNIO->et_found & HSP_ETCTR_MC_OUT) {
mcasts_out = (uint32_t)adaptorNIO->et_total.mcasts_out;
pkts_out -= mcasts_out;
if(adaptorNIO->procNetDev)
pkts_out -= mcasts_out;
}
if(adaptorNIO->et_found & HSP_ETCTR_BC_OUT) {
bcasts_out = (uint32_t)adaptorNIO->et_total.bcasts_out;
pkts_out -= bcasts_out;
if(adaptorNIO->procNetDev)
pkts_out -= bcasts_out;
}
if(adaptorNIO->et_found & HSP_ETCTR_UNKN) {
unknown_in = (uint32_t)adaptorNIO->et_total.unknown_in;
Expand Down

0 comments on commit ab1a8b5

Please sign in to comment.