From: Emil Mikulic Date: Mon, 17 Aug 2009 09:09:04 +0000 (+1000) Subject: Hack around snaplen problem in recent Ubuntu. X-Git-Tag: 3.0.713~13 X-Git-Url: https://unix4lyfe.org/gitweb/darkstat/commitdiff_plain/8a2e83c61ff46b04ab816a20c4252de418dc6a2a Hack around snaplen problem in recent Ubuntu. --- diff --git a/cap.c b/cap.c index 4d3ba51..9574f5d 100644 --- a/cap.c +++ b/cap.c @@ -86,6 +86,14 @@ cap_init(const char *device, const char *filter, int promisc) errx(1, "can't do PPPoE decoding on a non-Ethernet linktype"); } verbosef("calculated snaplen minimum %d", snaplen); +#ifdef linux + /* Ubuntu 9.04 has a problem where requesting snaplen <= 60 will + * give us 42 bytes, and we need at least 54 for TCP headers. + * + * Hack to set minimum snaplen to tcpdump's default: + */ + snaplen = max(snaplen, 68); +#endif if (want_snaplen > -1) snaplen = want_snaplen; verbosef("using snaplen %d", snaplen);