diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-02-14 11:18:57 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-02-14 11:18:57 +0000 |
commit | e92282fdcfa29e99c9a8a70a36b8f1dbae5a4264 (patch) | |
tree | a64ace553db24190341e6a16b6fbe38dd20b4096 /usr.sbin | |
parent | 5dc6706249691cc55bcae6ac72d1e9352879cd44 (diff) |
increase the default snaplen to 116, allows capture of pflog+ipv6+tcp
without knobs. ok djm, deraadt.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/tcpdump/interface.h | 15 | ||||
-rw-r--r-- | usr.sbin/tcpdump/tcpdump.c | 10 |
2 files changed, 12 insertions, 13 deletions
diff --git a/usr.sbin/tcpdump/interface.h b/usr.sbin/tcpdump/interface.h index 8a226682fd4..da7efdfdb50 100644 --- a/usr.sbin/tcpdump/interface.h +++ b/usr.sbin/tcpdump/interface.h @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.h,v 1.57 2008/10/16 12:57:01 mpf Exp $ */ +/* $OpenBSD: interface.h,v 1.58 2009/02/14 11:18:56 sthen Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -20,7 +20,7 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Id: interface.h,v 1.57 2008/10/16 12:57:01 mpf Exp $ (LBL) + * @(#) $Id: interface.h,v 1.58 2009/02/14 11:18:56 sthen Exp $ (LBL) */ #ifndef tcpdump_interface_h @@ -69,18 +69,13 @@ extern char *device; /* as specified by -i */ #define max(a,b) ((b)>(a)?(b):(a)) #endif -#ifndef INET6 /* * The default snapshot length. This value allows most printers to print * useful information while keeping the amount of unwanted data down. - * In particular, it allows for an ethernet header, tcp/ip header, and - * 14 bytes of data (assuming no ip options). + * In particular, it allows ethernet, tcp/ip headers, and a small amount + * of data, or to capture IPv6 and TCP headers after pflog encapsulation. */ -#define DEFAULT_SNAPLEN 68 -#else -#define DEFAULT_SNAPLEN 96 -#endif /* INET6 */ -#define SACK_SNAPLEN 94 +#define DEFAULT_SNAPLEN 116 #define IEEE802_11_SNAPLEN (DEFAULT_SNAPLEN + 30) #define IEEE802_11_RADIO_SNAPLEN (IEEE802_11_SNAPLEN + 64) diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c index 37031cd6b0c..81ee8f662d3 100644 --- a/usr.sbin/tcpdump/tcpdump.c +++ b/usr.sbin/tcpdump/tcpdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpdump.c,v 1.60 2008/04/18 21:35:11 djm Exp $ */ +/* $OpenBSD: tcpdump.c,v 1.61 2009/02/14 11:18:56 sthen Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -26,7 +26,7 @@ static const char copyright[] = "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] = - "@(#) $Id: tcpdump.c,v 1.60 2008/04/18 21:35:11 djm Exp $ (LBL)"; + "@(#) $Id: tcpdump.c,v 1.61 2009/02/14 11:18:56 sthen Exp $ (LBL)"; #endif /* @@ -352,7 +352,11 @@ main(int argc, char **argv) else if (strcasecmp(optarg, "tcp") == 0) packettype = PT_TCP; else if (strcasecmp(optarg, "sack") == 0) - snaplen = SACK_SNAPLEN; + /* + * kept for compatibility; DEFAULT_SNAPLEN + * used to be too short to capture SACK. + */ + ; else error("unknown packet type `%s'", optarg); break; |