From b5a68ca17b67659ac7a1d233ebea3507a486e65a Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 22 Oct 2021 10:33:24 +0200 Subject: [PATCH] fix wrap around glitch Signed-off-by: John Crispin --- netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netdev.c b/netdev.c index c69b273..a512022 100644 --- a/netdev.c +++ b/netdev.c @@ -141,7 +141,8 @@ static int get_counter_delta(__u32 new, __u32 old) else delta = new - old; - return delta; + + return delta > 0 ? delta : 0; } void