X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7b2c5a11a7bc236d72b440c4db5263edb23b4880..refs/heads/tcpdump-4.9:/in_cksum.c diff --git a/in_cksum.c b/in_cksum.c index efbc38e0..e9bed228 100644 --- a/in_cksum.c +++ b/in_cksum.c @@ -39,9 +39,9 @@ # include "config.h" #endif -#include +#include -#include "interface.h" +#include "netdissect.h" /* * Checksum routine for Internet Protocol family headers (Portable Version). @@ -73,7 +73,7 @@ in_cksum(const struct cksum_vec *vec, int veclen) for (; veclen != 0; vec++, veclen--) { if (vec->len == 0) continue; - w = (const uint16_t *)(void *)vec->ptr; + w = (const uint16_t *)(const void *)vec->ptr; if (mlen == -1) { /* * The first byte of this chunk is the continuation @@ -85,18 +85,18 @@ in_cksum(const struct cksum_vec *vec, int veclen) */ s_util.c[1] = *(const uint8_t *)w; sum += s_util.s; - w = (const uint16_t *)(void *)((const uint8_t *)w + 1); + w = (const uint16_t *)(const void *)((const uint8_t *)w + 1); mlen = vec->len - 1; } else mlen = vec->len; /* * Force to even boundary. */ - if ((1 & (unsigned long) w) && (mlen > 0)) { + if ((1 & (uintptr_t) w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(const uint8_t *)w; - w = (const uint16_t *)(void *)((const uint8_t *)w + 1); + w = (const uint16_t *)(const void *)((const uint8_t *)w + 1); mlen--; byte_swapped = 1; }