diff --git a/stats-lib-funcs.pl b/stats-lib-funcs.pl index da6c7926c..1488af9b6 100644 --- a/stats-lib-funcs.pl +++ b/stats-lib-funcs.pl @@ -454,6 +454,8 @@ sub stats_network_netstat } my $rbytes = ($total_rx_after - $total_rx_before) / $interval; my $tbytes = ($total_tx_after - $total_tx_before) / $interval; + $rbytes = $rbytes < 0 ? 0 : $rbytes; + $tbytes = $tbytes < 0 ? 0 : $tbytes; my @rs = ($rbytes, $tbytes); return \@rs; }