Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#

PROGNAME="p0f"
VERSION="3.07b"
VERSION="3.08b"

test "$CC" = "" && CC="gcc"

Expand Down
5 changes: 5 additions & 0 deletions docs/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 3.08b:
--------------

- An awful fix for a packet loss bug with some VMs.

Version 3.07b:
--------------

Expand Down
13 changes: 8 additions & 5 deletions p0f.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,10 @@ static void prepare_pcap(void) {

#else

/* PCAP timeouts tend to be broken, so we'll use a minimum value
/* PCAP timeouts tend to be broken, so we'll use a very small value
and rely on select() instead. */

pt = pcap_open_live((char*)use_iface, SNAPLEN, set_promisc, 1, pcap_err);
pt = pcap_open_live((char*)use_iface, SNAPLEN, set_promisc, 5, pcap_err);

#endif /* ^__CYGWIN__ */

Expand Down Expand Up @@ -805,12 +805,15 @@ static void live_event_loop(void) {
s32 pret, i;
u32 cur;

/* We use a 250 ms timeout to keep Ctrl-C responsive without resortng to
silly sigaction hackery or unsafe signal handler code. */
/* We had a 250 ms timeout to keep Ctrl-C responsive without resortng
to silly sigaction hackery or unsafe signal handler code. Unfortunately,
if poll() timeout is much longer than pcap timeout, we end up with
dropped packets on VMs. Seems like a kernel bug, but for now, this
loop is a bit busier than it needs to be... */

poll_again:

pret = poll(pfds, pfd_count, 250);
pret = poll(pfds, pfd_count, 10);

if (pret < 0) {
if (errno == EINTR) break;
Expand Down