diff options
Diffstat (limited to 'usr.sbin/tcpdump/print-ip6.c')
| -rw-r--r-- | usr.sbin/tcpdump/print-ip6.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c index 629c5e12fee..b9ef3df0e34 100644 --- a/usr.sbin/tcpdump/print-ip6.c +++ b/usr.sbin/tcpdump/print-ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-ip6.c,v 1.11 2009/10/27 23:59:55 deraadt Exp $ */ +/* $OpenBSD: print-ip6.c,v 1.12 2009/11/27 13:14:35 bluhm Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 @@ -114,9 +114,13 @@ ip6_print(register const u_char *bp, register int length) while (cp + hlen < snapend) { cp += hlen; +#ifndef IPPROTO_IPV4 +#define IPPROTO_IPV4 4 +#endif if (cp == (u_char *)(ip6 + 1) && nh != IPPROTO_TCP && nh != IPPROTO_UDP && - nh != IPPROTO_ESP && nh != IPPROTO_AH) { + nh != IPPROTO_ESP && nh != IPPROTO_AH && + (vflag || (nh != IPPROTO_IPV4 && nh != IPPROTO_IPV6))) { (void)printf("%s > %s: ", ip6addr_string(&ip6->ip6_src), ip6addr_string(&ip6->ip6_dst)); } @@ -171,12 +175,13 @@ ip6_print(register const u_char *bp, register int length) goto end; case IPPROTO_IPV6: ip6_print(cp, len); + if (! vflag) + printf(" (encap)"); goto end; -#ifndef IPPROTO_IPV4 -#define IPPROTO_IPV4 4 -#endif case IPPROTO_IPV4: ip_print(cp, len); + if (! vflag) + printf(" (encap)"); goto end; case IPPROTO_NONE: (void)printf("no next header"); |
