From b34ceb89c59e826bd1039a1fb6b5fc29af7341e9 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Thu, 4 Jun 2020 23:06:10 +0800 Subject: [PATCH] nwm_uds: Change ASSERT to LOG_ERROR This might be caused by some packet/status delay within the enet protocol, or may be caused by our not properly handling disconnection. Anyway, this situation *can* happen, and we should not crash Citra for a non-critical error. --- src/core/hle/service/nwm/nwm_uds.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index 0198b6075..ff6b9b197 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp @@ -344,9 +344,11 @@ void NWM_UDS::HandleSecureDataPacket(const Network::WifiPacket& packet) { // The packet wasn't addressed to us, we can only act as a router if we're the host. // However, we might have received this packet due to a broadcast from the host, in that // case just ignore it. - ASSERT_MSG(packet.destination_address == Network::BroadcastMac || - connection_status.status == static_cast(NetworkStatus::ConnectedAsHost), - "Can't be a router if we're not a host"); + if (packet.destination_address != Network::BroadcastMac && + connection_status.status != static_cast(NetworkStatus::ConnectedAsHost)) { + LOG_ERROR(Service_NWM, "Received packet addressed to others but we're not a host"); + return; + } if (connection_status.status == static_cast(NetworkStatus::ConnectedAsHost) && secure_data.dest_node_id != BroadcastNetworkNodeId) {