VirtualBox

Changeset 29616 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 18, 2010 11:55:55 AM (15 years ago)
Author:
vboxsync
Message:

netflt/win: fix more bug in loopback packet handling

Location:
trunk/src/VBox/HostDrivers/VBoxNetFlt/win
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c

    r29525 r29616  
    26272627
    26282628            ucbLength2Match = MIN(ucbMatch, cbLength1);
    2629             ucbLength2Match = MIN(ucbMatch, cbLength2);
     2629            ucbLength2Match = MIN(ucbLength2Match, cbLength2);
    26302630
    26312631            if(memcmp((PVOID*)pMemBuf1, (PVOID*)pMemBuf2, ucbLength2Match))
     
    27292729
    27302730            ucbLength2Match = MIN(ucbMatch, cbLength1);
    2731             ucbLength2Match = MIN(ucbMatch, cbLength2);
     2731            ucbLength2Match = MIN(ucbLength2Match, cbLength2);
    27322732
    27332733            if(memcmp((PVOID*)pMemBuf1, (PVOID*)pMemBuf2, ucbLength2Match))
     
    28182818
    28192819            ucbLength2Match = MIN(ucbMatch, cbLength1);
    2820             ucbLength2Match = MIN(ucbMatch, cbLength2);
     2820            ucbLength2Match = MIN(ucbLength2Match, cbLength2);
    28212821
    28222822            if(memcmp(pMemBuf1, pMemBuf2, ucbLength2Match))
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h

    r29108 r29616  
    4747
    4848#endif /* if DBG */
     49
     50/** get the PVBOXNETFLTINS from PADAPT */
     51#define PADAPT_2_PVBOXNETFLTINS(_pAdapt)  ( (PVBOXNETFLTINS)((uint8_t *)(_pAdapt) - RT_OFFSETOF(VBOXNETFLTINS, u.s.IfAdaptor)) )
     52/** get the PADAPT from PVBOXNETFLTINS */
     53#define PVBOXNETFLTINS_2_PADAPT(_pNetFlt) ( &(_pNetFlt)->u.s.IfAdaptor )
    4954
    5055
     
    413418{
    414419    PSEND_RSVD pSrv = (PSEND_RSVD)pPacket->ProtocolReserved;
    415     return vboxNetFltWinInterlockedSearchListEntry(&pAdapt->SendPacketQueue, &pSrv->ListEntry, true);
     420    bool bRet = vboxNetFltWinInterlockedSearchListEntry(&pAdapt->SendPacketQueue, &pSrv->ListEntry, true);
     421#ifdef DEBUG_misha
     422    PVBOXNETFLTINS pNetFlt = PADAPT_2_PVBOXNETFLTINS(pAdapt);
     423    Assert(bRet == (pNetFlt->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE));
     424#endif
     425    return bRet;
    416426}
    417427
     
    476486 * PADAPT, PVBOXNETFLTINS reference/dereference (i.e. retain/release) API *
    477487 **************************************************************************/
    478 
    479 /** get the PVBOXNETFLTINS from PADAPT */
    480 #define PADAPT_2_PVBOXNETFLTINS(_pAdapt)  ( (PVBOXNETFLTINS)((uint8_t *)(_pAdapt) - RT_OFFSETOF(VBOXNETFLTINS, u.s.IfAdaptor)) )
    481 /** get the PADAPT from PVBOXNETFLTINS */
    482 #define PVBOXNETFLTINS_2_PADAPT(_pNetFlt) ( &(_pNetFlt)->u.s.IfAdaptor )
    483488
    484489DECLHIDDEN(void) vboxNetFltWinWaitDereference(PADAPT_DEVICE pState);
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c

    r29108 r29616  
    13541354            if(pLb)
    13551355            {
     1356#ifndef DEBUG_NETFLT_RECV_NOPACKET
    13561357                /* should not be here */
    13571358                Assert(0);
    1358 
     1359#endif
    13591360                if(!vboxNetFltWinLbIsFromIntNet(pLb))
    13601361                {
     
    17021703                    {
    17031704#ifndef VBOX_LOOPBACK_USEFLAGS
    1704                         pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, true /* ??? no need to keep it, so remove */);
     1705                        pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, false);
    17051706                        if(!pLb)
    17061707#endif
     
    20312032            {
    20322033#ifndef VBOX_LOOPBACK_USEFLAGS
    2033                 PNDIS_PACKET pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, true /* ??? no need to keep it, so remove */);
     2034                PNDIS_PACKET pLb = vboxNetFltWinLbSearchLoopBack(pAdapt, pPacket, false);
    20342035                if(!pLb)
    20352036#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette