diff options
| author | 2017-06-13 21:50:22 -0500 | |
|---|---|---|
| committer | 2017-06-15 12:08:54 -0500 | |
| commit | 61ce89a55ac6ff12f881e3bba0220ac3f04fbf50 (patch) | |
| tree | 94f6a763cbc68198317556551ae31fe43a1cc44f | |
| parent | UDS: Stub SendTo to generate the unencrypted data frame with the right headers. (diff) | |
| download | yuzu-61ce89a55ac6ff12f881e3bba0220ac3f04fbf50.tar.gz yuzu-61ce89a55ac6ff12f881e3bba0220ac3f04fbf50.tar.xz yuzu-61ce89a55ac6ff12f881e3bba0220ac3f04fbf50.zip | |
UDS: Return the correct error messages in SendTo when not connected to a network or trying to send to itself.
| -rw-r--r-- | src/core/hle/service/nwm/nwm_uds.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index f6125825f..c43c5ca44 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp | |||
| @@ -404,15 +404,22 @@ static void SendTo(Interface* self) { | |||
| 404 | const VAddr input_address = rp.PopStaticBuffer(&desc_size, false); | 404 | const VAddr input_address = rp.PopStaticBuffer(&desc_size, false); |
| 405 | ASSERT(desc_size == data_size); | 405 | ASSERT(desc_size == data_size); |
| 406 | 406 | ||
| 407 | // TODO(Subv): Figure out the error if this is called while not connected to a network. | 407 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); |
| 408 | if (connection_status.status == static_cast<u32>(NetworkStatus::ConnectedAsClient) || | 408 | |
| 409 | connection_status.status == static_cast<u32>(NetworkStatus::ConnectedAsHost)) { | 409 | if (connection_status.status != static_cast<u32>(NetworkStatus::ConnectedAsClient) && |
| 410 | ASSERT_MSG(false, "Not connected to a network (unimplemented)"); | 410 | connection_status.status != static_cast<u32>(NetworkStatus::ConnectedAsHost)) { |
| 411 | rb.Push(ResultCode(ErrorDescription::NotAuthorized, ErrorModule::UDS, | ||
| 412 | ErrorSummary::InvalidState, ErrorLevel::Status)); | ||
| 413 | return; | ||
| 411 | } | 414 | } |
| 412 | 415 | ||
| 413 | // TODO(Subv): Do something with the flags. | 416 | if (dest_node_id == connection_status.network_node_id) { |
| 417 | rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::UDS, | ||
| 418 | ErrorSummary::WrongArgument, ErrorLevel::Status)); | ||
| 419 | return; | ||
| 420 | } | ||
| 414 | 421 | ||
| 415 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | 422 | // TODO(Subv): Do something with the flags. |
| 416 | 423 | ||
| 417 | constexpr size_t MaxSize = 0x5C6; | 424 | constexpr size_t MaxSize = 0x5C6; |
| 418 | if (data_size > MaxSize) { | 425 | if (data_size > MaxSize) { |