summaryrefslogtreecommitdiff
path: root/src/user/app/netstack
diff options
context:
space:
mode:
authordzwdz2022-08-22 14:17:46 +0200
committerdzwdz2022-08-22 14:17:46 +0200
commitca080278ff9b90b51acc731f562d3fd6f18ecb34 (patch)
tree3e85d2148309cdc2bcd56e2a1ac8e11731fd771e /src/user/app/netstack
parent6a4eb86c64fa42abcf9199cd968be089ee04c3bc (diff)
user/net: fix ip checksum calculation
Diffstat (limited to 'src/user/app/netstack')
-rw-r--r--src/user/app/netstack/util.c2
1 files changed, 1 insertions, 1 deletions
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;
}