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

pcap: fix timeout when TPACKET_V3 is used #15

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

adriansr
Copy link

Starting with libpcap 1.8.0, the TPACKET_V3 interface will be used under Linux. This has the side-effect of packet reads not timing out until a packet is received.

This patch detects when TPACKET_V3 is active and uses poll() on the capture file descriptor to ensure packet reads complete within the configured timeout.

Fixes elastic/beats#6535

Starting with libpcap 1.8.0, the TPACKET_V3 interface will be used
under Linux. This has the side-effect of packet reads not timing out
until a packet is received.

This patch detects when TPACKET_V3 is active and uses poll() on the
capture file descriptor to ensure packet reads complete within
the configured timeout.
@tsg tsg merged commit 555b863 into tsg:master Mar 15, 2018
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.

2 participants