diff options
author | Renato Botelho <renato@netgate.com> | 2017-02-23 06:37:07 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-02-23 06:37:07 -0300 |
commit | 4ef888db25896b2295f521c736ef04aa2e5e64ec (patch) | |
tree | 3fcc00dda536bd32ae85bc09f21be4081d32bad5 /contrib/tcpdump/in_cksum.c | |
parent | 272ffd7c3e4e5e27910eb918e2e36556f2a8ec3a (diff) | |
parent | af015c5bcac0e333adeec07eff0698bad3b91e95 (diff) | |
download | FreeBSD-src-4ef888db25896b2295f521c736ef04aa2e5e64ec.zip FreeBSD-src-4ef888db25896b2295f521c736ef04aa2e5e64ec.tar.gz |
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'contrib/tcpdump/in_cksum.c')
-rw-r--r-- | contrib/tcpdump/in_cksum.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/tcpdump/in_cksum.c b/contrib/tcpdump/in_cksum.c index 171728a..e9bed22 100644 --- a/contrib/tcpdump/in_cksum.c +++ b/contrib/tcpdump/in_cksum.c @@ -35,14 +35,13 @@ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 */ -#define NETDISSECT_REWORKED #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include <tcpdump-stdinc.h> +#include <netdissect-stdinc.h> -#include "interface.h" +#include "netdissect.h" /* * Checksum routine for Internet Protocol family headers (Portable Version). @@ -74,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 @@ -86,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; } |