summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-ip6.c
diff options
context:
space:
mode:
authordhill <dhill@openbsd.org>2011-06-27 16:54:14 +0000
committerdhill <dhill@openbsd.org>2011-06-27 16:54:14 +0000
commitc58f29658ae264b5b13794e5669e2eee0bb38243 (patch)
treec5d0590bf642a6ca5ae3491d0297bf7b36aa940c /usr.sbin/tcpdump/print-ip6.c
parentBackout the dynamic linker speed improvement diff for now, it still (diff)
downloadwireguard-openbsd-c58f29658ae264b5b13794e5669e2eee0bb38243.tar.xz
wireguard-openbsd-c58f29658ae264b5b13794e5669e2eee0bb38243.zip
fix an off by one which resulted in 'no next header' packets not being
displayed. help from bluhm@ OK claudio@
Diffstat (limited to 'usr.sbin/tcpdump/print-ip6.c')
-rw-r--r--usr.sbin/tcpdump/print-ip6.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/print-ip6.c b/usr.sbin/tcpdump/print-ip6.c
index 7f809c9954c..73fa784a47a 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.13 2010/04/06 16:01:57 jsg Exp $ */
+/* $OpenBSD: print-ip6.c,v 1.14 2011/06/27 16:54:14 dhill Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994
@@ -111,7 +111,7 @@ ip6_print(register const u_char *bp, register int length)
cp = (const u_char *)ip6;
nh = ip6->ip6_nxt;
- while (cp + hlen < snapend) {
+ while (cp + hlen <= snapend) {
cp += hlen;
#ifndef IPPROTO_IPV4
@@ -136,7 +136,7 @@ ip6_print(register const u_char *bp, register int length)
break;
case IPPROTO_FRAGMENT:
hlen = frag6_print(cp, (const u_char *)ip6);
- if (snapend <= cp + hlen)
+ if (snapend < cp + hlen)
goto end;
nh = *cp;
break;