From 36c9e97ad1672fa6f741db2145ff2da1c9a1c86d Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Tue, 2 Feb 2016 14:19:05 +0200 Subject: [PATCH] More Windows fixes --- ethsock.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ethsock.c b/ethsock.c index f1e9bdf..ca1e790 100644 --- a/ethsock.c +++ b/ethsock.c @@ -94,7 +94,14 @@ static bool get_hwaddr(uint8_t *hwaddr, const char *intf) continue; } - if (!strcmp(adapter->AdapterName, intf)) { +#ifndef NMRPFLASH_WINDOWS + if (!strcmp(intf, adapter->AdapterName)) +#else + /* Interface names from WinPcap are "\Device\NPF_{GUID}", while + * AdapterName from GetAdaptersInfo is just "{GUID}".*/ + if (strstr(intf, adapter->AdapterName)) +#endif + { if (adapter->AddressLength == 6) { for (i = 0; i != 6; ++i) { hwaddr[i] = adapter->Address[i]; @@ -310,10 +317,6 @@ int ethsock_list_all(void) memset(hwaddr, 0, 6); for (dev = devs; dev; dev = dev->next) { - if (dev->flags & PCAP_IF_LOOPBACK) { - continue; - } - if (!is_ethernet(dev->name)) { continue; } -- 2.25.1