aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcap-linux.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pcap-linux.c b/pcap-linux.c
index de21cd43..b558e459 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -4243,6 +4243,13 @@ static int pcap_handle_packet_mmap(
*
* Trim the snapshot length to be no longer than the
* specified snapshot length.
+ *
+ * XXX - an alternative is to put a filter, consisting
+ * of a "ret <snaplen>" instruction, on the socket
+ * in the activate routine, so that the truncation is
+ * done in the kernel even if nobody specified a filter;
+ * that means that less buffer space is consumed in
+ * the memory-mapped buffer.
*/
if (pcaphdr.caplen > (bpf_u_int32)handle->snapshot)
pcaphdr.caplen = handle->snapshot;