VirtualBox

Changeset 4934 in vbox


Ignore:
Timestamp:
Sep 20, 2007 2:31:27 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
24682
Message:

Bugfix.

File:
1 edited

Legend:

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

    r4643 r4934  
    2727#include <iprt/string.h>
    2828#include <iprt/thread.h>
     29#include <iprt/alloca.h>
    2930#include <iprt/asm.h>
    3031#include <iprt/semaphore.h>
     
    118119    STAM_PROFILE_START(&pThis->StatTransmit, a);
    119120
     121    /*
     122     * If the pvBuf is a high address, we'll have to copy it onto a
     123     * stack buffer of the tap driver will trap.
     124     */
     125    if ((uintptr_t)pvBuf >= _1M*512)
     126    {
     127        void *pvBufCopy = alloca(cb);
     128        memcpy(pvBufCopy, pvBuf, cb);
     129        pvBuf = pvBufCopy;
     130    }
     131
    120132#ifdef LOG_ENABLED
    121133    uint64_t u64Now = RTTimeProgramNanoTS();
     
    123135             cb, u64Now, u64Now - pThis->u64LastReceiveTS, u64Now - pThis->u64LastTransferTS));
    124136    pThis->u64LastTransferTS = u64Now;
    125 #endif
    126137    Log2(("%s Send: pvBuf=%p cb=%#zx\n"
    127138          "%.*Vhxd\n",
    128139          pThis->szName, pvBuf, cb, cb, pvBuf));
     140#endif
    129141
    130142    ULONG Parm[2] = { ~0UL, ~0UL }; /* mysterious output */
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