]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fixed the BPF compiler for Linux. The BPF code used to truncate the
authortorsten <torsten>
Sun, 6 Aug 2000 01:22:39 +0000 (01:22 +0000)
committertorsten <torsten>
Sun, 6 Aug 2000 01:22:39 +0000 (01:22 +0000)
packets after the snaplen. On Linux this hinders us from inquiring
the original packet size so I removed that feature for Linux builds.

gencode.c

index b36a416da377193f55acbad8a3f921b1310d4741..4b19e0e9f81bae462ac82fb6405cc1a8aff9fa1e 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.115 2000-07-25 05:50:08 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.116 2000-08-06 01:22:39 torsten Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -283,7 +283,16 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
        }
 
        netmask = mask;
+       
+       /* On Linux we do not use the BPF filter to truncate the packet
+        * since the kernel provides other ways for that. In fact if we
+        * are using the packet filter for that duty we will be unable 
+        * to acquire the original packet size.  -- Torsten */
+#ifndef linux
        snaplen = pcap_snapshot(p);
+#else
+       snaplen = 0xffff;
+#endif
        if (snaplen == 0) {
                snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
                         "snaplen of 0 rejects all packets");