#include "config.h"
#endif
-#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.7 2001-08-20 17:53:54 fenner Exp $";
-#endif
-
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
+#include <tcpdump-stdinc.h>
-#include <netinet/in.h>
-
-#include <netdb.h>
#include <stdio.h>
#include "interface.h"
{
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;
}
osp=1;
cp +=4 ;
}
-
+
if (osp) {
fputs("[S] ",stdout);
if (vflag)
(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);
}