From 4c0e2761e81ebc44e41fde79e3a75749b5b4461c Mon Sep 17 00:00:00 2001 From: riccardom Date: Tue, 20 Apr 2010 17:10:35 +0000 Subject: [PATCH] Add hack to have an understandable device name on !WINDOWS (at least linux :) and print the selected device name on log level 2. --- desmume/src/wifi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desmume/src/wifi.cpp b/desmume/src/wifi.cpp index 5c4d5ef74..dc8a5f6f6 100644 --- a/desmume/src/wifi.cpp +++ b/desmume/src/wifi.cpp @@ -34,6 +34,7 @@ #ifndef WXPORT #include "windriver.h" #endif + #define PCAP_DEVICE_NAME description #else #include #include @@ -43,6 +44,7 @@ #define socket_t int #define sockaddr_t struct sockaddr #define closesocket close + #define PCAP_DEVICE_NAME name #endif #ifndef INVALID_SOCKET @@ -1927,6 +1929,8 @@ static pcap_if_t * WIFI_index_device(pcap_if_t *alldevs, int index) for(int i = 0; i < index; i++) curr = curr->next; + WIFI_LOG(2, "SoftAP: using %s as device.\n", curr->PCAP_DEVICE_NAME); + return curr; } @@ -1963,7 +1967,7 @@ bool SoftAP_Init() wifi_bridge = driver->PCAP_open(dev->name, PACKET_SIZE, PCAP_OPENFLAG_PROMISCUOUS, 1, errbuf); if(wifi_bridge == NULL) { - WIFI_LOG(1, "SoftAP: PCap: failed to open %s: %s\n", (dev->description ? dev->description : "the network adapter"), errbuf); + WIFI_LOG(1, "SoftAP: PCap: failed to open %s: %s\n", dev->PCAP_DEVICE_NAME, errbuf); return false; }