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

Add pcap_open_live() timeout for sock read to Linux backend #86

Closed
guyharris opened this issue Apr 15, 2013 · 1 comment
Closed

Add pcap_open_live() timeout for sock read to Linux backend #86

guyharris opened this issue Apr 15, 2013 · 1 comment

Comments

@guyharris
Copy link
Member

Converted from SourceForge issue 1642214, submitted by egbert_e

The timeout for socket reads (recvfrom()) is not implemented for the Linux backend. This causes problems with nmap which uses libpcap now: when scanning a closed port nmap will hang forever.
The attached trivial patch adds this timeout.

@guyharris
Copy link
Member Author

Submitted by guy_harris

Logged In: YES
user_id=541179
Originator: NO

Any application that thinks that the timeout in pcap_open_live() guarantees that a read will block for no more than the specified amount of time is broken on more platforms than just Linux. In Solaris, for example, the timeout is implemented - but, by design and intent, the timer starts when the first packet arrives (that's the way bufmod's timer works). (I wish BPF had worked that way, so people didn't get used to the idea that you could use the timeout for polling. They might've had to make select()/poll() work with BPF devices sooner than they did....)

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

No branches or pull requests

1 participant