Skip to content
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

Merged
merged 4 commits into from
Mar 18, 2015
Merged

Conversation

rlane
Copy link
Contributor

@rlane rlane commented Mar 18, 2015

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.

rlane added 2 commits March 18, 2015 10:16
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.
@jnealtowns
Copy link
Contributor

ACK

@bsn-abat
Copy link

ABAT: START_MERGE: Log file at http://vbs22/abat/2015.03.18.2019-m.oftest.master/abat.log

@bsn-abat
Copy link

ABAT: AUTO-REJECT: Your change failed pre-merge validation defined in oftest/.abat-automerge. See log for details.

INSTRUCTIONS: Please fix your problem by

  1. Reviewing the logs below and git commiting a fix.

  2. Use git push to add new commits to this same remote branch/pull request.

  3. Get another code review approval from your co-worker indicated by a line of "ACK" in comment, or add another comment yourself with a line of "R_E_T_R_Y (Remove the underscores)". That will cause abat to try to merge your code again.

Log file at http://vbs22/abat/2015.03.18.2019-m.oftest.master/abat.log
/cc

@rlane
Copy link
Contributor Author

rlane commented Mar 18, 2015

RETRY

@bsn-abat
Copy link

ABAT: START_MERGE: Log file at http://vbs22/abat/2015.03.18.2042-m.oftest.master/abat.log

@bsn-abat
Copy link

ABAT: AUTO-REJECT: Your change failed pre-merge validation defined in oftest/.abat-automerge. See log for details.

INSTRUCTIONS: Please fix your problem by

  1. Reviewing the logs below and git commiting a fix.

  2. Use git push to add new commits to this same remote branch/pull request.

  3. Get another code review approval from your co-worker indicated by a line of "ACK" in comment, or add another comment yourself with a line of "R_E_T_R_Y (Remove the underscores)". That will cause abat to try to merge your code again.

Log file at http://vbs22/abat/2015.03.18.2042-m.oftest.master/abat.log
/cc

@rlane
Copy link
Contributor Author

rlane commented Mar 18, 2015

RETRY

@bsn-abat
Copy link

ABAT: START_MERGE: Log file at http://vbs21/abat/2015.03.18.2106-m.oftest.master/abat.log

@bsn-abat bsn-abat merged commit 31cd7d8 into floodlight:master Mar 18, 2015
bsn-abat pushed a commit that referenced this pull request Mar 18, 2015
Avoid using libpcap on Linux (#168)
@bsn-abat
Copy link

ABAT: ACCEPT: Successfully merged

In case you want to see the build log, check out :
Log file at http://vbs21/abat/2015.03.18.2106-m.oftest.master/abat.log
/cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants