Changeset 28075 in vbox
- Timestamp:
- Apr 7, 2010 11:42:21 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59785
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/intnetinline.h
r28071 r28075 579 579 * @param pHdr The frame header returned by 580 580 * INTNETRingAllocateFrame. 581 * @param cbUsed The amount of space actually used. 581 * @param cbUsed The amount of space actually used. This does 582 * not include the GSO part. 582 583 */ 583 584 DECLINLINE(void) INTNETRingCommitFrameEx(PINTNETRINGBUF pRingBuf, PINTNETHDR pHdr, size_t cbUsed) … … 589 590 INTNETHDR_ASSERT_SANITY(pHdr, pRingBuf); 590 591 Assert(pRingBuf->offWriteCom == ((uintptr_t)pHdr - (uintptr_t)pRingBuf)); 592 593 if (pHdr->u16Type == INTNETHDR_TYPE_GSO) 594 cbUsed += sizeof(PDMNETWORKGSO); 591 595 592 596 /* -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r28068 r28075 462 462 463 463 /** 464 * Reads an entire SG into a fittingly size buffer.465 *466 * @param pSG The SG list to read.467 * @param pvBuf The buffer to read into (at least pSG->cbTotal in size).468 */469 DECLINLINE(void) intnetR0SgRead(PCINTNETSG pSG, void *pvBuf)470 {471 if (pSG->cSegsUsed == 1)472 {473 Assert(pSG->cbTotal == pSG->aSegs[0].cb);474 memcpy(pvBuf, pSG->aSegs[0].pv, pSG->cbTotal);475 }476 else477 {478 uint8_t *pbDst = (uint8_t *)pvBuf;479 unsigned const cSegs = pSG->cSegsUsed; Assert(cSegs == pSG->cSegsUsed);480 for (unsigned iSeg = 0; iSeg < cSegs; iSeg++)481 {482 uint32_t cbSeg = pSG->aSegs[iSeg].cb;483 Assert(cbSeg <= pSG->cbTotal && (uintptr_t)(pbDst - (uint8_t *)pvBuf) + cbSeg <= pSG->cbTotal);484 memcpy(pbDst, pSG->aSegs[iSeg].pv, cbSeg);485 pbDst += cbSeg;486 }487 }488 }489 490 491 492 493 494 495 496 /**497 464 * Retain an interface. 498 465 * … … 1526 1493 if (RT_SUCCESS(rc)) 1527 1494 { 1528 intnetR0SgRead(pSG, pvDst);1495 INTNETSgRead(pSG, pvDst); 1529 1496 if (pNewDstMac) 1530 1497 ((PRTNETETHERHDR)pvDst)->DstMac = *pNewDstMac; … … 2437 2404 INTNETSgInitTempGso(&Sg, pvCurFrame, cbFrame, pGso); 2438 2405 if (pNetwork->fFlags & INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE) 2439 intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, pHdr->cbFrame, true /*fGso*/, (uint16_t *)&Sg.fFlags);2406 intnetR0IfSnoopAddr(pIf, (uint8_t *)pvCurFrame, cbFrame, true /*fGso*/, (uint16_t *)&Sg.fFlags); 2440 2407 intnetR0NetworkSend(pNetwork, pIf, 0, &Sg, !!pTrunkIf); 2441 2408 }
Note:
See TracChangeset
for help on using the changeset viewer.