-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snaplen requires BPF filter to be applied #201
Comments
(And I should check to make sure |
@guyharris I thought of this, but I kept running into difficulties, primarily this one: It doesn't appear there's anything preventing |
There is. The (Note that, if it could get to the module before the |
We will cherry-pick the-tcpdump-group/libpcap@6c893c13 to nmap/libpcap's wpcap-1.9 branch for the next release and mark this issue resolved in our changelog. Thanks for the help! |
That, and 141253c471119db0761d73c2fc095b82a2017eb3, are commits to a test program, to allow the test program not to set the snapshot length and not to set the filter; I made them in order to be able to test the change I'm proposing to |
Oops, that commit checked in my "add a filter when activating" change before it was tested - it doesn't compile. It was intended to check in only a fix to the test program; I've backed out the |
You need a filter in order to tell the kernel what the snapshot length is. This should handle GitHub issues #947 and nmap/npcap#201.
OK, that's the commit you want - the-tcpdump-group/libpcap@a0a9c27. (I had to hammer on libpcap a bit - AppVeyor must have installed a new version of VS 2019, because a bunch of switch-statement warnings started popping up and, as we're building with |
You need a filter in order to tell the kernel what the snapshot length is. This should handle GitHub issues the-tcpdump-group#947 and nmap/npcap#201.
This is fixed now, right? |
Yes, I just promised my family an early start to the weekend if I got the
Npcap release out, so I haven't had time to go through the issues and close
them.
…On Sat, Jul 11, 2020, 3:27 AM Guy Harris ***@***.***> wrote:
This is fixed now, right?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#201 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPVSFONMRBCY3HA3TSHOZTR3AO7TANCNFSM4OPJVQIA>
.
|
This issue is fixed in Npcap 0.9995 by backporting an unreleased changed from upstream libpcap. |
Inherited problem from WinPcap: snaplen is implemented as a modification to BPF filter in
pcap_compile()
, which means that the only way to have it work is to follow this procedure (aspcap_open_live()
does internally):pcap_set_snaplen()
""
empty string withpcap_compile()
pcap_setfilter()
Doing this in any other order will not work.
Solution: we need to implement a snaplen set operation, probably as a new IoControl code, and expose it via the existing
PacketSetSnapLen()
function. Then libpcap has to callPacketSetSnapLen()
in the appropriate places, which it currently only does for DAG cards. This would be fine for them to do even with backwards compatibility in mind, since on non-DAG adapters,PacketSetSnapLen()
has historically been a no-op.The text was updated successfully, but these errors were encountered: