-
Notifications
You must be signed in to change notification settings - Fork 109
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
Avoid using libpcap on Linux #168
Conversation
The original reason we switched to libpcap was that it handled VLAN offload for us. Now that libpcap isn't reliable on Linux (TPACKET_V3 is broken) we have to reconstruct the VLAN tag ourselves.
We still need to use libpcap on other operating systems. Using the packet socket directly on Linux avoids TPACKET_V3 which is horribly broken.
ACK |
ABAT: START_MERGE: Log file at http://vbs22/abat/2015.03.18.2019-m.oftest.master/abat.log |
ABAT: AUTO-REJECT: Your change failed pre-merge validation defined in oftest/.abat-automerge. See log for details. INSTRUCTIONS: Please fix your problem by
Log file at http://vbs22/abat/2015.03.18.2019-m.oftest.master/abat.log |
RETRY |
ABAT: START_MERGE: Log file at http://vbs22/abat/2015.03.18.2042-m.oftest.master/abat.log |
ABAT: AUTO-REJECT: Your change failed pre-merge validation defined in oftest/.abat-automerge. See log for details. INSTRUCTIONS: Please fix your problem by
Log file at http://vbs22/abat/2015.03.18.2042-m.oftest.master/abat.log |
RETRY |
ABAT: START_MERGE: Log file at http://vbs21/abat/2015.03.18.2106-m.oftest.master/abat.log |
Avoid using libpcap on Linux (#168)
ABAT: ACCEPT: Successfully merged In case you want to see the build log, check out : |
Reviewer: @jnealtowns
Starting with Ubuntu 14.04 libpcap uses the TPACKET_V3 interface to receive packets. TPACKET_V3 is unsuitable for applications with low packet rates that want to receive packets immediately. Newer versions of libpcap have an API
pcap_set_immediate_mode
that reverts to using TPACKET_V2. However, I couldn't find any pcap Python libraries on pip that supported this call. The pypcap package we use is unmaintained, so we can't just add it. My personal workaround of downgrading libpcap isn't scalable.The original reason we started using libpcap was that it handled VLAN offload and reconstructed the offloaded tag in the packet data. This isn't easy to do in pure Python because the offloaded tag is delivered in a recvmsg control message, but at this point it's easier than fixing pypcap.