summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2020-07-12 14:26:32 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2020-07-12 14:26:32 +0000
commitc8c8de6a0512ae25f3315bc52ebbda1603f98b0e (patch)
tree66ec0d1cd273f413d0dfe57b3f6fb8c02d771334
parentae368885efc15e7a056a4d404750c49f2ff2d25e (diff)
downloadVirtualBox-svn-c8c8de6a0512ae25f3315bc52ebbda1603f98b0e.tar.gz
Main/USBProxyBackendUsbIp.cpp: The 'unused' u32Status fields are actually signed and should be called i32Status. bugref:9790
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@85279 cfe28804-0f27-0410-a406-dd0f0b0b656f
-rw-r--r--src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp b/src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp
index eea140306cd..378f732d44c 100644
--- a/src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp
+++ b/src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp
@@ -122,7 +122,7 @@ typedef struct UsbIpReqDevList
/** Command code. */
uint16_t u16Cmd;
/** Status field, unused. */
- int32_t u32Status;
+ int32_t i32Status;
} UsbIpReqDevList;
/** Pointer to a device list request. */
typedef UsbIpReqDevList *PUsbIpReqDevList;
@@ -143,7 +143,7 @@ typedef struct UsbIpRetDevList
/** Command code. */
uint16_t u16Cmd;
/** Status field, unused. */
- int32_t u32Status;
+ int32_t i32Status;
/** Number of exported devices. */
uint32_t u32DevicesExported;
} UsbIpRetDevList;
@@ -781,7 +781,8 @@ int USBProxyBackendUsbIp::startListExportedDevicesReq()
UsbIpReqDevList ReqDevList;
ReqDevList.u16Version = RT_H2N_U16(USBIP_VERSION);
ReqDevList.u16Cmd = RT_H2N_U16(USBIP_INDICATOR_REQ | USBIP_REQ_RET_DEVLIST);
- ReqDevList.u32Status = RT_H2N_U32(0);
+ ReqDevList.i32Status = RT_H2N_S32(0);
+
rc = RTTcpWrite(m->hSocket, &ReqDevList, sizeof(ReqDevList));
if (RT_SUCCESS(rc))
advanceState(kUsbIpRecvState_Hdr);
@@ -894,7 +895,8 @@ int USBProxyBackendUsbIp::processData()
/* Check that the reply matches our expectations. */
if ( RT_N2H_U16(m->Scratch.RetDevList.u16Version) == USBIP_VERSION
&& RT_N2H_U16(m->Scratch.RetDevList.u16Cmd) == USBIP_REQ_RET_DEVLIST
- && RT_N2H_U32(m->Scratch.RetDevList.u32Status) == USBIP_STATUS_SUCCESS)
+ && RT_N2H_S32(m->Scratch.RetDevList.i32Status) == USBIP_STATUS_SUCCESS)
+
{
/* Populate the number of exported devices in the list and go to the next state. */
m->cDevicesLeft = RT_N2H_U32(m->Scratch.RetDevList.u32DevicesExported);
@@ -907,7 +909,7 @@ int USBProxyBackendUsbIp::processData()
{
LogRelMax(10, ("USB/IP: Host sent an invalid reply to the list exported device request (Version: %#x Cmd: %#x Status: %#x)\n",
RT_N2H_U16(m->Scratch.RetDevList.u16Version), RT_N2H_U16(m->Scratch.RetDevList.u16Cmd),
- RT_N2H_U32(m->Scratch.RetDevList.u32Status)));
+ RT_N2H_S32(m->Scratch.RetDevList.i32Status)));
/* Disconnect and start over. */
advanceState(kUsbIpRecvState_None);
disconnect();