On Oct 31, 2012, at 3:35 PM, Ani Sinha <a...@aristanetworks.com> wrote:

> yes but if the packet is passed to the filter within libpcap (when we
> are not using the kernel filter) before the reinsertion,

...that would be a bug.

Currently, that bug doesn't exist in the recvfrom() code path, but *does* 
appear to exist in the tpacket code path - and that code path also runs the 
filter before the SLL header is constructed.  That should be fixed.

Yes, it means constructing the SLL header and inserting the tags blah blah blah 
on packets that might not pass the filter, but in most cases the filtering 
should be done in the kernel, not userland, when doing a live capture, and in 
those cases where the filtering can't done in the kernel, you're already 
somewhat hosed by the fact that the packets are being copied to the buffer and 
wakeups are being delivered before the packets are being filtered.

_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Reply via email to