tcpdump mailing list archives

Re: pcap_t not writeable on OpenBSD


From: Fernando Gont <fernando () gont com ar>
Date: Tue, 10 Jan 2012 20:06:21 -0300

On 01/10/2012 05:13 PM, Sam Roberts wrote:
On Mon, Jan 9, 2012 at 8:49 PM, Fernando Gont <fernando () gont com ar> wrote:
I'm doing I/O multiplexing with the pcap descriptor, and it turns out
that on OpenBSD the underlying descriptor for a pcap_t is never writeable.
Note: No problems in Linux and FreeBSD -- so far only in OpenBSD.

Are you capturing, or injecting?

Both.

Shouldn't you be waiting for it to be readable for capture?

Yes, but I wait for writeability for injecting, to avoid blocking.


For injection, on linux anyhow, a PF_PACKET device is always
writeable, but I'm pretty sure it discards packets if you write too
fast.

Does pcap_inject() or the like block, or does it actually discard the
"exceeding" packets?

Thanks,
-- 
Fernando Gont
e-mail: fernando () gont com ar || fgont () si6networks com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1



-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: