Hi, folks,

I'm doing I/O multiplexing with a pcap descriptor (select()ing on the
underlying descriptor, to avoid having my app block on libpcap calls).

When it comes to checking for writeability, it turns out that in most
OSes this is basically a noop (the descriptor is always readable). For
example, in FreeBSD and Linux, select() always return the descriptor as
"writeable", without actually performing any real checks on the BPF or
the like.

However, in OpenBSD (and apparently NetBSD, too) the underlying
descriptor for a pcap_t is never writeable.

If anything, it'd seem that having select() always report that the
pcap_t descriptor is "writeable" is a better choice.

That said, it would be great to have select() return "writeable" with
similar semantics to those of the Sockets API, such that one knows when
it's "safe" to pcap_inject() packets...

Thoughts?

Thanks!

Best regards,
-- 
Fernando Gont
e-mail: [email protected] || [email protected]
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1

Reply via email to