summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2016-10-30 04:03:29 +0000
committerjsg <jsg@openbsd.org>2016-10-30 04:03:29 +0000
commita8a9bd56243335ff56ed5eda77df09428d00a481 (patch)
tree9ae5109465ab87fac67c9bea3a709d47abf20f3d
parentFix an issue found by naddy@ where the installer was not able (diff)
downloadwireguard-openbsd-a8a9bd56243335ff56ed5eda77df09428d00a481.tar.xz
wireguard-openbsd-a8a9bd56243335ff56ed5eda77df09428d00a481.zip
Replace a snapend test in ip_print() with a call to TCHECK2 as there
is already a trunc label with the same printf in the function.
-rw-r--r--usr.sbin/tcpdump/print-ip.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/print-ip.c b/usr.sbin/tcpdump/print-ip.c
index a5475941479..b039cee3c00 100644
--- a/usr.sbin/tcpdump/print-ip.c
+++ b/usr.sbin/tcpdump/print-ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-ip.c,v 1.45 2015/11/16 00:16:39 mmcc Exp $ */
+/* $OpenBSD: print-ip.c,v 1.46 2016/10/30 04:03:29 jsg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -357,11 +357,8 @@ ip_print(const u_char *bp, u_int length)
const u_char *pktp = packetp;
const u_char *send = snapend;
+ TCHECK2(bp[0], 1);
ip = (const struct ip *)bp;
- if ((u_char *)(ip + 1) > snapend) {
- printf("[|ip]");
- return;
- }
/*
* If the IP header is not aligned, copy into abuf.