From 96647a898d62d699808316238dfb933d960413f2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 00:55:46 +0200 Subject: Merging upstream version 7.0.16-dfsg. Signed-off-by: Daniel Baumann --- src/VBox/Devices/Network/testcase/tstIntNetR0.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/VBox/Devices/Network/testcase') diff --git a/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp b/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp index 5cb94894..515f2065 100644 --- a/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp +++ b/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp @@ -203,9 +203,13 @@ INTNETR3DECL(int) SUPR0MemFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr) static int tstIntNetSendBuf(PINTNETRINGBUF pRingBuf, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, void const *pvBuf, size_t cbBuf) { - INTNETSG Sg; - IntNetSgInitTemp(&Sg, (void *)pvBuf, (uint32_t)cbBuf); - int rc = intnetR0RingWriteFrame(pRingBuf, &Sg, NULL); + union + { + uint8_t abBuf[sizeof(INTNETSG) + sizeof(INTNETSEG)]; + INTNETSG SG; + } u; + IntNetSgInitTemp(&u.SG, (void *)pvBuf, (uint32_t)cbBuf); + int rc = intnetR0RingWriteFrame(pRingBuf, &u.SG, NULL); if (RT_SUCCESS(rc)) rc = IntNetR0IfSend(hIf, pSession); return rc; @@ -269,9 +273,13 @@ static DECLCALLBACK(int) SendThread(RTTHREAD hThreadSelf, void *pvArg) : iFrame % 1519 + sizeof(RTMAC) * 2 + sizeof(unsigned); pHdr->iFrame = iFrame; - INTNETSG Sg; - IntNetSgInitTemp(&Sg, abBuf, cb); - RTTEST_CHECK_RC_OK(g_hTest, rc = intnetR0RingWriteFrame(&pArgs->pBuf->Send, &Sg, NULL)); + union + { + uint8_t abBuf[sizeof(INTNETSG) + sizeof(INTNETSEG)]; + INTNETSG SG; + } u; + IntNetSgInitTemp(&u.SG, abBuf, cb); + RTTEST_CHECK_RC_OK(g_hTest, rc = intnetR0RingWriteFrame(&pArgs->pBuf->Send, &u.SG, NULL)); if (RT_SUCCESS(rc)) RTTEST_CHECK_RC_OK(g_hTest, rc = IntNetR0IfSend(pArgs->hIf, g_pSession)); if (RT_FAILURE(rc) && ++cErrors > 64) -- cgit v1.2.3