diff options
author | dzwdz | 2022-08-22 14:17:46 +0200 |
---|---|---|
committer | dzwdz | 2022-08-22 14:17:46 +0200 |
commit | ca080278ff9b90b51acc731f562d3fd6f18ecb34 (patch) | |
tree | 3e85d2148309cdc2bcd56e2a1ac8e11731fd771e | |
parent | 6a4eb86c64fa42abcf9199cd968be089ee04c3bc (diff) |
user/net: fix ip checksum calculation
-rw-r--r-- | src/user/app/netstack/util.c | 2 |
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; } |