From 7818dbf4a469e273f2e5f857e65df68bdff13eb7 Mon Sep 17 00:00:00 2001 From: risso Date: Sun, 10 Jul 2005 17:52:54 +0000 Subject: [PATCH] Added a missing initialization of pcap_t::timeout when an adapter is opened with pcap_open_live. This bug caused pcap_setnonblock to misbehave when the adapter was set to blocking mode. --- pcap-win32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcap-win32.c b/pcap-win32.c index a0778c4..e539068 100644 --- a/pcap-win32.c +++ b/pcap-win32.c @@ -32,7 +32,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.25.2.2 2005-06-10 03:48:56 risso Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.25.2.3 2005-07-10 17:52:54 risso Exp $ (LBL)"; #endif #include @@ -498,6 +498,9 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, /* Set the buffer size */ p->bufsize = PcapBufSize; + /* Store the timeout. Used by pcap_setnonblock() */ + p->timeout= to_ms; + /* allocate Packet structure used during the capture */ if((p->Packet = PacketAllocatePacket())==NULL) {