From 31cee7e4c80acf1bb1228d89ef286473e8a09dbf Mon Sep 17 00:00:00 2001 From: scribam Date: Sun, 4 Feb 2018 22:43:22 +0100 Subject: [PATCH] Make cellNetCtlGetInfo returns the correct value in disconnected mode --- rpcs3/Emu/Cell/Modules/cellNetCtl.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp index 1132707a20..798551bd5f 100644 --- a/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp +++ b/rpcs3/Emu/Cell/Modules/cellNetCtl.cpp @@ -125,20 +125,25 @@ error_code cellNetCtlGetInfo(s32 code, vm::ptr info) { cellNetCtl.todo("cellNetCtlGetInfo(code=0x%x (%s), info=*0x%x)", code, InfoCodeToName(code), info); + if (code == CELL_NET_CTL_INFO_ETHER_ADDR) + { + // dummy values set + std::memset(info->ether_addr.data, 0xFF, sizeof(info->ether_addr.data)); + return CELL_OK; + } + + if (g_cfg.net.net_status == CELL_NET_CTL_STATE_Disconnected) + { + return CELL_NET_CTL_ERROR_NOT_CONNECTED; + } + if (code == CELL_NET_CTL_INFO_MTU) { info->mtu = 1500; } else if (code == CELL_NET_CTL_INFO_LINK) { - if (g_cfg.net.net_status != CELL_NET_CTL_STATE_Disconnected) - { - info->link = CELL_NET_CTL_LINK_CONNECTED; - } - else - { - info->link = CELL_NET_CTL_LINK_DISCONNECTED; - } + info->link = CELL_NET_CTL_LINK_CONNECTED; } else if (code == CELL_NET_CTL_INFO_IP_ADDRESS) {