Changeset 68500 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/win
- Timestamp:
- Aug 22, 2017 10:16:26 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 117655
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
r68112 r68500 1396 1396 return NULL; 1397 1397 } 1398 const ULONG cbAlignmentMask = sizeof(USHORT) - 1; /* Microsoft LB/FO provider expects packets to be aligned at word boundary. */ 1399 ULONG cbAlignedFrame = (pSG->cbTotal + cbAlignmentMask) & ~cbAlignmentMask; 1400 Assert(cbAlignedFrame >= pSG->cbTotal); 1401 Assert(cbFrame >= cbAlignedFrame); 1398 1402 NET_BUFFER *pBuffer = NET_BUFFER_LIST_FIRST_NB(pBufList); 1399 NDIS_STATUS Status = NdisRetreatNetBufferDataStart(pBuffer, pSG->cbTotal, 0 /** @todo DataBackfill */, NULL);1403 NDIS_STATUS Status = NdisRetreatNetBufferDataStart(pBuffer, cbAlignedFrame, 0 /** @todo DataBackfill */, NULL); 1400 1404 if (Status == NDIS_STATUS_SUCCESS) 1401 1405 { … … 1408 1412 pDst += pSG->aSegs[i].cb; 1409 1413 } 1414 if (cbAlignedFrame > pSG->cbTotal) 1415 { 1416 Log4(("vboxNetLwfWinSGtoNB: padding %d-byte packet with %d zero bytes", pSG->cbTotal, cbAlignedFrame - pSG->cbTotal)); 1417 NdisZeroMemory(pDst, cbAlignedFrame - pSG->cbTotal); 1418 } 1410 1419 Log4(("vboxNetLwfWinSGtoNB: allocated NBL+NB 0x%p\n", pBufList)); 1411 1420 pBufList->SourceHandle = pModule->hFilter; … … 1414 1423 { 1415 1424 LogError(("vboxNetLwfWinSGtoNB: failed to obtain the buffer pointer (size=%u)\n", pSG->cbTotal)); 1416 NdisAdvanceNetBufferDataStart(pBuffer, pSG->cbTotal, false, NULL); /** @todo why bother? */1425 NdisAdvanceNetBufferDataStart(pBuffer, cbAlignedFrame, false, NULL); /** @todo why bother? */ 1417 1426 NdisFreeNetBufferList(pBufList); 1418 1427 pBufList = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.