From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 28 14:50:02 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E233106566C for ; Tue, 28 Sep 2010 14:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 11AC68FC16 for ; Tue, 28 Sep 2010 14:50:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8SEo1Fx086243 for ; Tue, 28 Sep 2010 14:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8SEo1DU086242; Tue, 28 Sep 2010 14:50:01 GMT (envelope-from gnats) Resent-Date: Tue, 28 Sep 2010 14:50:01 GMT Resent-Message-Id: <201009281450.o8SEo1DU086242@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, jhell Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722C81065694 for ; Tue, 28 Sep 2010 14:44:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 613338FC1C for ; Tue, 28 Sep 2010 14:44:38 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o8SEicMX050527 for ; Tue, 28 Sep 2010 14:44:38 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o8SEicUu050526; Tue, 28 Sep 2010 14:44:38 GMT (envelope-from nobody) Message-Id: <201009281444.o8SEicUu050526@www.freebsd.org> Date: Tue, 28 Sep 2010 14:44:38 GMT From: jhell To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/151036: Default snaplen of tcpdump(1) is not adequate to todays packet filters X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2010 14:50:02 -0000 >Number: 151036 >Category: bin >Synopsis: Default snaplen of tcpdump(1) is not adequate to todays packet filters >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Sep 28 14:50:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: jhell >Release: stable/8 r213195 >Organization: >Environment: N/A >Description: 100% of the time when using tcpdump(1) on a packet dump from pflog a user will see a message of "[bad hdr length 0 - too short, < 20]" if they are not using a snaplen '-s' greater than or equal to that of the pflog or similiar capture which happens to be 116. >How-To-Repeat: tcpdump -nr /var/log/pflog >Fix: Always add '-s 116' to tcpdump on the command line or patch tcpdump(1) to use a default snaplen of 116 for ipv4 and 88 for ipv6. Patching should solve a lot of misconception of what is actually happening. Patch attached with submission follows: Index: contrib/tcpdump/interface.h =================================================================== --- contrib/tcpdump/interface.h (revision 213242) +++ contrib/tcpdump/interface.h (working copy) @@ -88,9 +88,9 @@ * useful information while keeping the amount of unwanted data down. */ #ifndef INET6 -#define DEFAULT_SNAPLEN 68 /* ether + IPv4 + TCP + 14 */ +#define DEFAULT_SNAPLEN 88 /* ether + IPv4 + TCP + 34 */ #else -#define DEFAULT_SNAPLEN 96 /* ether + IPv6 + TCP + 22 */ +#define DEFAULT_SNAPLEN 116 /* ether + IPv6 + TCP + 42 */ #endif #ifndef BIG_ENDIAN Index: contrib/tcpdump/netdissect.h =================================================================== --- contrib/tcpdump/netdissect.h (revision 213242) +++ contrib/tcpdump/netdissect.h (working copy) @@ -177,9 +177,9 @@ * In particular, it allows for an ethernet header, tcp/ip header, and * 14 bytes of data (assuming no ip options). */ -#define DEFAULT_SNAPLEN 68 +#define DEFAULT_SNAPLEN 88 #else -#define DEFAULT_SNAPLEN 96 +#define DEFAULT_SNAPLEN 116 #endif #ifndef BIG_ENDIAN >Release-Note: >Audit-Trail: >Unformatted: