From 7df5431b83d70cd9dd05c9802f4e45ac01ac65f4 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Wed, 7 Aug 2024 19:38:44 +0300 Subject: [PATCH] Fix sanity check --- stats-lib-funcs.pl | 2 ++ 1 file changed, 2 insertions(+) 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; }