Ethereal-cvs: [Ethereal-cvs] cvs commit: ethereal capture.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Dec 2000 19:44:19 -0600 (CST)
guy         2000/12/27 19:44:19 CST

  Modified files:
    .                    capture.c 
  Log:
  It turns out that the read timeout in Solaris's "bufmod" STREAMS module
  doesn't work like the read timeout in BPF - the timer doesn't start
  until at least one packet has arrived.
  
  I think that's the way read timeouts should work on *all* packet capture
  mechanisms, but it does mean that Solaris will, on a quiet net, exhibit
  the same symptoms that Linux used to exhibit before we put in a
  "select()" call to wait until either packets arrive or a timer expires -
  the "pcap_dispatch()" call blocks until a packet arrives, so the display
  doesn't get updated and Ethereal doesn't respond to user input until a
  packet arrives.
  
  Furthermore, Linux isn't the only OS that lacks any read timeout
  on its packet capture mechanism; the others will also have that problem.
  
  We therefore do the "select()" on *all* platforms other than the BSDs
  (where the timer starts when the read is done, and can be used for
  polling); I don't know whether it's necessary on Digital UNIX, but I
  suspect it's necessary on SunOS 4.x (as the 5.x "bufmod" is probably
  derived from the 4.x one, and the 5.x one, as per the above, starts the
  timer when a packet arrives), and it may even be necessary on 3.x, those
  (BSD, SunOS including 5.x, and Digital UNIX) apparently being the only
  UNIXes that appear to have such a read timeout.
  
  Revision  Changes    Path
  1.134     +30 -9     ethereal/capture.c