summaryrefslogtreecommitdiff
path: root/bpqether.c
diff options
context:
space:
mode:
Diffstat (limited to 'bpqether.c')
-rw-r--r--bpqether.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/bpqether.c b/bpqether.c
index 8de8801..cccb42a 100644
--- a/bpqether.c
+++ b/bpqether.c
@@ -56,7 +56,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include <process.h>
#include "pcap.h"
-#include "../CommonSource/bpq32.h"
+#include "bpq32.h"
//#include "packet32.h"
//#include "ntddndis.h"
@@ -153,8 +153,31 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
}
switch (fn)
{
+ case 7:
+
+ if (PCAP->adhandle == 0)
+ {
+ // No handle.
+
+ if (PCAP->Adapter[0])
+ {
+ // Try reopening periodically
+
+ PCAP->pcap_reopen_delay --;
+
+ if (PCAP->pcap_reopen_delay < 0)
+ if (OpenPCAP(PCAP) == FALSE)
+ PCAP->pcap_reopen_delay = 300; // Retry every 30 seconds
+ }
+ }
+
+ return 0;
+
case 1: // poll
+ if (PCAP->adhandle == 0)
+ return 0;
+
res = pcap_next_exx(PCAP->adhandle, &header, &pkt_data);
if (res == 0)