summaryrefslogtreecommitdiffstats
path: root/src/VBox/Devices/Network/SrvIntNetR0.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:52 +0000
commitcd47c2446f1a9dee96610f298989848f8986a8be (patch)
tree02c30d62a9164987d0aaba2f72c58a50053205d6 /src/VBox/Devices/Network/SrvIntNetR0.cpp
parentReleasing progress-linux version 7.0.14-dfsg-4~progress7.99u1. (diff)
downloadvirtualbox-cd47c2446f1a9dee96610f298989848f8986a8be.tar.xz
virtualbox-cd47c2446f1a9dee96610f298989848f8986a8be.zip
Merging upstream version 7.0.16-dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Devices/Network/SrvIntNetR0.cpp')
-rw-r--r--src/VBox/Devices/Network/SrvIntNetR0.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/VBox/Devices/Network/SrvIntNetR0.cpp b/src/VBox/Devices/Network/SrvIntNetR0.cpp
index 1a2b055d..728cd25a 100644
--- a/src/VBox/Devices/Network/SrvIntNetR0.cpp
+++ b/src/VBox/Devices/Network/SrvIntNetR0.cpp
@@ -4104,9 +4104,16 @@ INTNETR0DECL(int) IntNetR0IfSend(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)
* Process the send buffer.
*/
INTNETSWDECISION enmSwDecision = INTNETSWDECISION_BROADCAST;
- INTNETSG Sg; /** @todo this will have to be changed if we're going to use async sending
- * with buffer sharing for some OS or service. Darwin copies everything so
- * I won't bother allocating and managing SGs right now. Sorry. */
+
+ /** @todo this will have to be changed if we're going to use async sending
+ * with buffer sharing for some OS or service. Darwin copies everything so
+ * I won't bother allocating and managing SGs right now. Sorry. */
+ union
+ {
+ uint8_t abBuf[sizeof(INTNETSG) + sizeof(INTNETSEG)];
+ INTNETSG SG;
+ } u;
+
PINTNETHDR pHdr;
while ((pHdr = IntNetRingGetNextFrameToRead(&pIf->pIntBuf->Send)) != NULL)
{
@@ -4115,10 +4122,10 @@ INTNETR0DECL(int) IntNetR0IfSend(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)
{
/* Send regular frame. */
void *pvCurFrame = IntNetHdrGetFramePtr(pHdr, pIf->pIntBuf);
- IntNetSgInitTemp(&Sg, pvCurFrame, pHdr->cbFrame);
+ IntNetSgInitTemp(&u.SG, pvCurFrame, pHdr->cbFrame);
if (pNetwork->fFlags & INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE)
- intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, pHdr->cbFrame, false /*fGso*/, (uint16_t *)&Sg.fFlags);
- enmSwDecision = intnetR0NetworkSend(pNetwork, pIf, 0 /*fSrc*/, &Sg, pDstTab);
+ intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, pHdr->cbFrame, false /*fGso*/, (uint16_t *)&u.SG.fFlags);
+ enmSwDecision = intnetR0NetworkSend(pNetwork, pIf, 0 /*fSrc*/, &u.SG, pDstTab);
}
else if (u8Type == INTNETHDR_TYPE_GSO)
{
@@ -4128,10 +4135,10 @@ INTNETR0DECL(int) IntNetR0IfSend(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession)
if (RT_LIKELY(PDMNetGsoIsValid(pGso, pHdr->cbFrame, cbFrame)))
{
void *pvCurFrame = pGso + 1;
- IntNetSgInitTempGso(&Sg, pvCurFrame, cbFrame, pGso);
+ IntNetSgInitTempGso(&u.SG, pvCurFrame, cbFrame, pGso);
if (pNetwork->fFlags & INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE)
- intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, cbFrame, true /*fGso*/, (uint16_t *)&Sg.fFlags);
- enmSwDecision = intnetR0NetworkSend(pNetwork, pIf, 0 /*fSrc*/, &Sg, pDstTab);
+ intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, cbFrame, true /*fGso*/, (uint16_t *)&u.SG.fFlags);
+ enmSwDecision = intnetR0NetworkSend(pNetwork, pIf, 0 /*fSrc*/, &u.SG, pDstTab);
}
else
{