summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-10-30 04:03:30 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-10-30 04:03:30 +0000
commit392ba14d746b00c73502d9ebb8ff9e300eb41ecf (patch)
treea8beea61481fe006e916f0cd50695e77c5dd3eee /usr.sbin
parent81fb79d4d2f5306771c395b836ac1994713707b1 (diff)
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.
Diffstat (limited to 'usr.sbin')
-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.