X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/a11713da52b0a72a1cb17f00fc339d332866e9ca..2075ea09c1535b547298fa47b51b2bfe41229032:/print-ospf.c diff --git a/print-ospf.c b/print-ospf.c index 098cbdf2..cd3f6542 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -23,20 +23,15 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.30 2001-06-15 22:17:34 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.32 2002-08-01 08:53:22 risso Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include +#include -#include - -#include #include #include "interface.h" @@ -78,6 +73,10 @@ static struct tok type2str[] = { static char tstr[] = " [|ospf]"; +#ifdef WIN32 +#define inline __inline +#endif /* WIN32 */ + /* Forwards */ static inline void ospf_print_seqage(u_int32_t, time_t); static inline void ospf_print_bits(const struct bits *, u_char); @@ -403,8 +402,9 @@ ospf_decode_v2(register const struct ospfhdr *op, printf(" bdr %s", ipaddr_string(&op->ospf_hello.hello_bdr)); if (vflag) { - printf(" nbrs"); ap = op->ospf_hello.hello_neighbor; + if ((u_char *)ap < dataend) + printf(" nbrs"); while ((u_char *)ap < dataend) { TCHECK(*ap); printf(" %s", ipaddr_string(ap)); @@ -521,7 +521,7 @@ ospf_print(register const u_char *bp, register u_int length, /* value. If it's not valid, say so and return */ TCHECK(op->ospf_type); cp = tok2str(type2str, "type%d", op->ospf_type); - printf(" OSPFv%d-%s %d:", op->ospf_version, cp, length); + printf("OSPFv%d-%s %d:", op->ospf_version, cp, length); if (*cp == 't') return;