[tcpdump-workers] select()ing on a pcap descriptor in Solaris

2014-08-14 Thread Fernando Gont
Folks,

While trying to select() on a pcap descriptor in solaris, I found the
following:

1) It seems that pcap descriptors are never readable or writeable. (--
This is different from *BSD and Linux, where at least you seem to be
able to check for readability)

2) It would seem that even trying to select() on such descriptors causes
trouble. For example, I get a kind of random "Bad file number" error
from select when I try to check for readability/writeability.

Is the above assessment correct? Should I not even try to call select()
on pcap descriptors in Solaris?

Thanks!

Best regards,
-- 
Fernando Gont
e-mail: ferna...@gont.com.ar || fg...@si6networks.com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1



___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] select()ing on a pcap descriptor in Solaris

2014-08-14 Thread Guy Harris

On Aug 14, 2014, at 1:34 PM, Fernando Gont  wrote:

> While trying to select() on a pcap descriptor in solaris

Which version?  Solaris 11 (in which pcap descriptors should refer to BPF 
devices), or earlier (in which pcap descriptors should refer to DLPI STREAMS 
devices)?

> I found the following:
> 
> 1) It seems that pcap descriptors are never readable or writeable. (--
> This is different from *BSD and Linux, where at least you seem to be
> able to check for readability)
> 
> 2) It would seem that even trying to select() on such descriptors causes
> trouble. For example, I get a kind of random "Bad file number" error
> from select when I try to check for readability/writeability.

I wouldn't expect that prior to Solaris 11 - select() and poll() Just Work on 
STREAMS devices, as I remember.

It could, however, be that Sun^WOracle screwed up with BPF; unfortunately, 
Solaris 11 is ClosedSolaris, so I can't just look at the source and see what 
they did wrong.

I'll try this on my Solaris 11 virtual machine.

> Is the above assessment correct? Should I not even try to call select()
> on pcap descriptors in Solaris?

If they screwed up on Solaris 11, you probably shouldn't try to call select(); 
instead, you should try to call Oracle and report this as a bug (and tell them 
that, if they fix this, they should fix it so that if you have a timeout set 
with BIOCSRTIMEOUT, the timer should start as soon as a select() or poll() is 
done, so that, when the timeout expires, it can report the descriptor as 
readable - the original BPF didn't do that, and all the *BSDs and OS X 
eventually fixed it).
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] select()ing on a pcap descriptor in Solaris

2014-08-14 Thread Fernando Gont
Hi, Guy,

On 08/14/2014 06:01 PM, Guy Harris wrote:
> 
> On Aug 14, 2014, at 1:34 PM, Fernando Gont 
> wrote:
> 
>> While trying to select() on a pcap descriptor in solaris
> 
> Which version?  Solaris 11 (in which pcap descriptors should refer to
> BPF devices), or earlier (in which pcap descriptors should refer to
> DLPI STREAMS devices)?

fgont@solaris:~/ipv6toolkit$ uname -a
SunOS solaris 5.11 11.1 i86pc i386 i86pc


>> I found the following:
>> 
>> 1) It seems that pcap descriptors are never readable or writeable.
>> (-- This is different from *BSD and Linux, where at least you seem
>> to be able to check for readability)
>> 
>> 2) It would seem that even trying to select() on such descriptors
>> causes trouble. For example, I get a kind of random "Bad file
>> number" error from select when I try to check for
>> readability/writeability.
> 
> I wouldn't expect that prior to Solaris 11 - select() and poll() Just
> Work on STREAMS devices, as I remember.

You wouldn't expect them to fail, or to work properly?



> It could, however, be that Sun^WOracle screwed up with BPF;
> unfortunately, Solaris 11 is ClosedSolaris, so I can't just look at
> the source and see what they did wrong.

Seems like a long time since I last installed it... But I could try with
the CD they released circa 2009 -- that one was open source.



> I'll try this on my Solaris 11 virtual machine.
> 
>> Is the above assessment correct? Should I not even try to call
>> select() on pcap descriptors in Solaris?
> 
> If they screwed up on Solaris 11, you probably shouldn't try to call
> select(); instead, you should try to call Oracle and report this as a
> bug (and tell them that, if they fix this, they should fix it so that
> if you have a timeout set with BIOCSRTIMEOUT, the timer should start
> as soon as a select() or poll() is done, so that, when the timeout
> expires, it can report the descriptor as readable - the original BPF
> didn't do that, and all the *BSDs and OS X eventually fixed it).

Point noted. I'll wait for your response above, and will proceed as
indicated if necessary.

Thanks so much (yet one more time)!

Best regards,
-- 
Fernando Gont
e-mail: ferna...@gont.com.ar || fg...@si6networks.com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1



___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers