From 0954dac86e07daee633f8e801a8e226866649e39 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Sun, 4 Apr 2010 18:40:25 +0000 Subject: [PATCH] Fix NCDGetWirelessMacAddress always returning the hard coded MAC address instead of the "real" one git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5277 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp index f4290f9e7a..dda36fcede 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -296,21 +296,21 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress) for (unsigned int dev = 0; dev < 3; dev++ ) { strncpy(ifr.ifr_name, check_devices[dev], IFNAMSIZ-1); - ret = ioctl(fd, SIOCGIFHWADDR, &ifr); if (ret == 0) { INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETWIRELESSMACADDRESS returning local MAC address of %s", check_devices[dev]); Memory::WriteBigEData((const u8*)ifr.ifr_hwaddr.sa_data, CommandBuffer.PayloadBuffer.at(1).m_Address, 4); - close(fd); break; } } + if (ret != 0) + { + // fall back to the hardcoded address + Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4); + } close(fd); - // fall back to the hardcoded address - Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4); - //#elif defined(WIN32) // TODO