From ca080278ff9b90b51acc731f562d3fd6f18ecb34 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 22 Aug 2022 14:17:46 +0200 Subject: user/net: fix ip checksum calculation --- src/user/app/netstack/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user/app/netstack/util.c b/src/user/app/netstack/util.c index 7c484f3..9981aa3 100644 --- a/src/user/app/netstack/util.c +++ b/src/user/app/netstack/util.c @@ -25,7 +25,7 @@ uint16_t ip_checksum(const uint8_t *buf, size_t len) { buf += 2; len -= 2; } if (len) c += (*buf) << 8; - while (c >= 0xFFFF) + while (c > 0xFFFF) c = (c & 0xFFFF) + (c >> 16); return ~c; } -- cgit v1.2.3