X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b9ac23ce92ca22483d56ee3192c54aa8f782f9ac..b58cddb15484ab7abbdd8d12e38a8ab768923f29:/print-ospf.c diff --git a/print-ospf.c b/print-ospf.c index 094977ed..95874cef 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.27 1999-11-21 09:36:58 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.31 2001-06-28 04:34:51 fenner Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -35,9 +35,6 @@ static const char rcsid[] = #include #include -#include -#include -#include #include #include @@ -47,6 +44,8 @@ static const char rcsid[] = #include "ospf.h" +#include "ip.h" + struct bits { u_int32_t bit; const char *str; @@ -404,8 +403,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)); @@ -510,12 +510,6 @@ ospf_print(register const u_char *bp, register u_int length, op = (struct ospfhdr *)bp; ip = (struct ip *)bp2; - /* Print the source and destination address */ -#if 0 - (void) printf("%s > %s:", - ipaddr_string(&ip->ip_src), - ipaddr_string(&ip->ip_dst)); -#endif /* XXX Before we do anything else, strip off the MD5 trailer */ TCHECK(op->ospf_authtype); @@ -528,7 +522,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;