Use non-zero timeout in pcap_open_live
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Jan 2012 13:44:14 +0000 (14:44 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Jan 2012 13:45:50 +0000 (14:45 +0100)
http://www.tcpdump.org/pcap.html says:

  to_ms is the read time out in milliseconds (a value of 0 means
  no time out; on at least some platforms, this means that you may
  wait until a sufficient number of packets arrive before seeing
  any packets, so you should use a non-zero timeout)

Nice..

src/main/radsniff.c

index c5d5db4..5da57c5 100644 (file)
@@ -527,7 +527,7 @@ int main(int argc, char *argv[])
                exit(1);
 
        } else {
-               descr = pcap_open_live(dev, 65536, 1, 0, errbuf);
+               descr = pcap_open_live(dev, 65536, 1, 1, errbuf);
        }
        if (descr == NULL)
        {