X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/4c6bada75863c064314bc52daf899e37cc8b39e3..1afd3f308e25f7bf070f3932a28ed6b2be8173f6:/print-mobile.c diff --git a/print-mobile.c b/print-mobile.c index e767beb3..de4eab1d 100644 --- a/print-mobile.c +++ b/print-mobile.c @@ -41,17 +41,12 @@ #endif #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.8 2002-06-01 23:50:32 guy Exp $"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.15 2004-03-24 01:58:14 guy Exp $"; #endif -#include -#include -#include +#include -#include - -#include #include #include "interface.h" @@ -77,12 +72,13 @@ mobile_print(const u_char *bp, u_int length) { const u_char *cp = bp +8 ; const struct mobile_ip *mob; + struct cksum_vec vec[1]; u_short proto,crc; u_char osp =0; /* old source address present */ mob = (const struct mobile_ip *)bp; - if (length < MOBILE_SIZE) { + if (length < MOBILE_SIZE || !TTEST(*mob)) { fputs("[|mobile]", stdout); return; } @@ -94,7 +90,7 @@ mobile_print(const u_char *bp, u_int length) osp=1; cp +=4 ; } - + if (osp) { fputs("[S] ",stdout); if (vflag) @@ -106,7 +102,9 @@ mobile_print(const u_char *bp, u_int length) (void)printf("> %s ",ipaddr_string(&mob->odst)); (void)printf("(oproto=%d)",proto>>8); } - if (in_cksum((u_short *)mob, osp ? 12 : 8, 0)!=0) { + vec[0].ptr = (const u_int8_t *)(void *)mob; + vec[0].len = osp ? 12 : 8; + if (in_cksum(vec, 1)!=0) { (void)printf(" (bad checksum %d)",crc); }