Changeset 100883 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Aug 16, 2023 11:39:26 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
r100872 r100883 2373 2373 case VIRTIONET_CTRL_MQ_VQ_PAIRS_SET: 2374 2374 { 2375 size_t cbRemaining = pVirtqBuf->cbPhysSend - sizeof(*pCtrlPktHdr);2375 size_t cbRemaining = pVirtqBuf->cbPhysSend; 2376 2376 2377 2377 AssertMsgReturn(cbRemaining > sizeof(cVirtqPairs), … … 2425 2425 2426 2426 uint16_t uVlanId; 2427 size_t cbRemaining = pVirtqBuf->cbPhysSend - sizeof(*pCtrlPktHdr);2428 2429 AssertMsgReturn(cbRemaining > sizeof(uVlanId),2427 size_t cbRemaining = pVirtqBuf->cbPhysSend; 2428 2429 AssertMsgReturn(cbRemaining >= sizeof(uVlanId), 2430 2430 ("DESC chain too small for VIRTIONET_CTRL_VLAN cmd processing"), VIRTIONET_ERROR); 2431 2431 … … 2433 2433 virtioCoreR3VirtqBufDrain(&pThis->Virtio, pVirtqBuf, &uVlanId, sizeof(uVlanId)); 2434 2434 2435 AssertMsgReturn(uVlanId >VIRTIONET_MAX_VLAN_ID,2435 AssertMsgReturn(uVlanId < VIRTIONET_MAX_VLAN_ID, 2436 2436 ("%s VLAN ID out of range (VLAN ID=%u)\n", pThis->szInst, uVlanId), VIRTIONET_ERROR); 2437 2437 … … 2492 2492 * Allocate buffer and read in the control command 2493 2493 */ 2494 AssertMsgReturnVoid(pVirtqBuf->cbPhysSend >= sizeof(VIRTIONET_CTRL_HDR_T),2495 ("DESC chain too small for CTRL pkt header"));2496 2497 2494 VIRTIONET_CTRL_HDR_T CtrlPktHdr; RT_ZERO(CtrlPktHdr); 2498 virtioCoreR3VirtqBufDrain(&pThis->Virtio, pVirtqBuf, &CtrlPktHdr, 2499 RT_MIN(pVirtqBuf->cbPhysSend, sizeof(CtrlPktHdr))); 2495 AssertLogRelMsgReturnVoid(pVirtqBuf->cbPhysSend >= sizeof(CtrlPktHdr), 2496 ("DESC chain too small for CTRL pkt header")); 2497 virtioCoreR3VirtqBufDrain(&pThis->Virtio, pVirtqBuf, &CtrlPktHdr, sizeof(CtrlPktHdr)); 2500 2498 2501 2499 Log7Func(("[%s] CTRL COMMAND: class=%d command=%d\n", pThis->szInst, CtrlPktHdr.uClass, CtrlPktHdr.uCmd));
Note:
See TracChangeset
for help on using the changeset viewer.