summaryrefslogtreecommitdiff
path: root/in_cksum.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-12-10 20:14:57 -0800
committerGuy Harris <guy@alum.mit.edu>2018-12-10 20:14:57 -0800
commit8bf7a9197cc52f195d2b76b61f3424fcc4f318a7 (patch)
treeeff8e3cfb828b3842a101faec2071f4becad947d /in_cksum.c
parent1af79d4adf40a736340e9f5fd87b93c9bc847191 (diff)
downloadtcpdump-8bf7a9197cc52f195d2b76b61f3424fcc4f318a7.tar.gz
Squelch a warning.
We're returning the calculated checksum result modulo 65536, given that Internet checksums are 16-bit; throw in a cast to let MSVC know that this is intended.
Diffstat (limited to 'in_cksum.c')
-rw-r--r--in_cksum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/in_cksum.c b/in_cksum.c
index c9c200d6..eb7c634f 100644
--- a/in_cksum.c
+++ b/in_cksum.c
@@ -196,5 +196,5 @@ in_cksum_shouldbe(uint16_t sum, uint16_t computed_sum)
shouldbe += ntohs(computed_sum);
shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
- return shouldbe;
+ return (uint16_t)shouldbe;
}