VirtualBox

Changeset 12621 in vbox for trunk/src


Ignore:
Timestamp:
Sep 21, 2008 4:14:59 PM (16 years ago)
Author:
vboxsync
Message:

Solaris/vboxnetflt: fixes.

File:
1 edited

Legend:

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

    r12620 r12621  
    663663    if (pState->CurType == kPromiscStream)
    664664    {
    665         /*
    666          * Careful; Use RTMemAllocZ here to zero-out uninitialized fields.
    667          */
    668         vboxnetflt_promisc_stream_t *pPromiscStream = RTMemAllocZ(sizeof(vboxnetflt_promisc_stream_t));
     665        vboxnetflt_promisc_stream_t *pPromiscStream = RTMemAlloc(sizeof(vboxnetflt_promisc_stream_t));
    669666        if (RT_UNLIKELY(!pPromiscStream))
    670667        {
     
    678675        pPromiscStream->fRawMode = false;
    679676        pPromiscStream->ModeReqId = 0;
     677        pPromiscStream->pHead = NULL;
     678        pPromiscStream->pTail = NULL;
     679        pPromiscStream->cLoopback = 0;
    680680        pStream = (vboxnetflt_stream_t *)pPromiscStream;
    681681    }
     
    17871787            pCur = pNext;
    17881788        }
     1789        pPromiscStream->pHead = NULL;
     1790        pPromiscStream->pTail = NULL;
    17891791        pPromiscStream->cLoopback = 0;
    17901792    }
     
    24202422
    24212423                pPromiscStream->pHead = pCur;
    2422                 pPromiscStream->pTail = pPromiscStream->pHead;
     2424                pPromiscStream->pTail = pCur;
    24232425                pPromiscStream->cLoopback++;
    24242426
     
    24382440                break;
    24392441            }
     2442
     2443            Assert(pPromiscStream->pTail);
    24402444
    24412445            pCur = RTMemAllocZ(sizeof(VBOXNETFLTPACKETID));
     
    24602464         * Maximum loopback queue size reached. Re-use head as tail.
    24612465         */
    2462         PVBOXNETFLTPACKETID pCur = pPromiscStream->pHead;
     2466        Assert(pPromiscStream->pHead);
     2467        Assert(pPromiscStream->pTail);
     2468
     2469        pCur = pPromiscStream->pHead;
    24632470        pPromiscStream->pHead = pPromiscStream->pHead->pNext;
    24642471        pPromiscStream->pTail->pNext = pCur;
     
    25432550         */
    25442551        pCur->cbPacket = 0;
    2545         pPromiscStream->cLoopback--;
    25462552        LogFlow((DEVICE_NAME ":vboxNetFltSolarisIsOurMBlk found packet %p cLoopback=%d\n", pMsg, pPromiscStream->cLoopback));
    25472553        return true;
     
    29562962    {
    29572963        vboxnetflt_promisc_stream_t *pPromiscStream = pThis->u.s.pvPromiscStream;
     2964        if (!pPromiscStream)
     2965            return VERR_INVALID_POINTER;
     2966
    29582967        queue_t *pPromiscWriteQueue = WR(pPromiscStream->Stream.pReadQueue);
    29592968
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