VirtualBox

Changeset 10735 in vbox for trunk


Ignore:
Timestamp:
Jul 18, 2008 6:41:46 AM (16 years ago)
Author:
vboxsync
Message:

intnet: Fixed incorrect trunk switching, unless we know how is the recepient all frames hits the trunk/wire - found during an early morning shower review :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r10734 r10735  
    682682     * because I didn't implement async SG handling yet. Which is why we currently
    683683     * require the trunk to be locked, well, one of the reasons.
     684     *
     685     * Another reason is that the intnetR0NetworkSendUnicast code may have to
     686     * call into the trunk interface component to do package switching.
    684687     */
    685688    AssertReturnVoid(fTrunkLocked); /* to be removed. */
     
    818821
    819822    /*
    820      * Send it to the trunk? Only consider this if we didn't find an recipient
    821      * or if the trunk is in some form or promiscuous mode.
     823     * Send it to the trunk?
     824     * If we didn't find the recipient on the internal network the
     825     * frame will hit the wire.
    822826     */
    823827    PINTNETTRUNKIF pTrunkIf = pNetwork->pTrunkIF;
     
    827831    {
    828832        uint32_t fDst = 0;
     833
     834        /* promiscuous checks first as they are cheaper than pfnIsHostMac. */
    829835        if (    pTrunkIf->fPromiscuousWire
    830836            &&  !(pNetwork->fFlags & (INTNET_OPEN_FLAGS_IGNORE_PROMISC | INTNET_OPEN_FLAGS_QUIETLY_IGNORE_PROMISC | INTNET_OPEN_FLAGS_IGNORE_PROMISC_TRUNK_WIRE | INTNET_OPEN_FLAGS_QUIETLY_IGNORE_PROMISC_TRUNK_WIRE)) )
     
    833839            ||  pTrunkIf->pIfPort->pfnIsPromiscuous(pTrunkIf->pIfPort) )
    834840            fDst |= INTNETTRUNKDIR_HOST;
    835         else if (   !fExactIntNetRecipient      /* if you have duplicate mac addresses, you're screwed. */
    836                  && pTrunkIf->pIfPort->pfnIsHostMac(pTrunkIf->pIfPort, &pEthHdr->MacDst))
    837             fDst |= INTNETTRUNKDIR_HOST;
     841
     842        if (    fDst != (INTNETTRUNKDIR_HOST | INTNETTRUNKDIR_WIRE)
     843            &&  !fExactIntNetRecipient  /* if you have duplicate mac addresses, you're screwed. */ )
     844        {
     845            if (pTrunkIf->pIfPort->pfnIsHostMac(pTrunkIf->pIfPort, &pEthHdr->MacDst))
     846                fDst |= INTNETTRUNKDIR_HOST;
     847            else
     848                fDst |= INTNETTRUNKDIR_WIRE;
     849        }
     850
    838851        if (fDst)
    839852            intnetR0TrunkIfSend(pTrunkIf, pNetwork, fDst, pSG, fTrunkLocked);
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