From 24eb57b7fb35926fa643914bfab291158c89ed09 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Thu, 18 Jun 2015 20:35:53 +0300 Subject: [PATCH] Fixed WinPCap support. --- ethernet.cpp | 8 ++++---- od-win32/win32_uaenet.cpp | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ethernet.cpp b/ethernet.cpp index 2acf8503..e62740fa 100644 --- a/ethernet.cpp +++ b/ethernet.cpp @@ -31,7 +31,7 @@ static struct netdriverdata slirpd = UAENET_SLIRP, _T("slirp"), _T("SLIRP User Mode NAT"), 1500, - { 0x00,0x80,0x10,50,51,52 }, + { 0x00,0x00,0x00,50,51,52 }, 1 }; static struct netdriverdata slirpd2 = @@ -39,7 +39,7 @@ static struct netdriverdata slirpd2 = UAENET_SLIRP_INBOUND, _T("slirp_inbound"), _T("SLIRP + Open ports (21-23,80)"), 1500, - { 0x00,0x80,0x10,50,51,52 }, + { 0x00,0x00,0x00,50,51,52 }, 1 }; @@ -210,8 +210,8 @@ bool ethernet_enumerate (struct netdriverdata **nddp, const TCHAR *name) #ifdef WITH_UAENET_PCAP nd = uaenet_enumerate (NULL); if (nd) { - for (int i = 0; i < nd[i].active; i++) { - nddp[j++] = nd; + for (int i = 0; nd[i].active; i++) { + nddp[j++] = &nd[i]; } } #endif diff --git a/od-win32/win32_uaenet.cpp b/od-win32/win32_uaenet.cpp index 7ea7a43e..37483bad 100644 --- a/od-win32/win32_uaenet.cpp +++ b/od-win32/win32_uaenet.cpp @@ -288,6 +288,9 @@ void uaenet_enumerate_free (void) static struct netdriverdata *enumit (const TCHAR *name) { int cnt; + + if (name == NULL) + return tds; for (cnt = 0; cnt < MAX_TOTAL_NET_DEVICES; cnt++) { TCHAR mac[20]; struct netdriverdata *tc = tds + cnt; -- 2.47.3