VirtualBox

Changeset 10846

Show
Ignore:
Timestamp:
07/24/08 00:03:16 (2 months ago)
Author:
vboxsync
Message:

intnet: removed autoactivation of the interface on open.

Files:

Legend:

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

    r10845 r10846  
    17581758                    if (RT_SUCCESS(rc)) 
    17591759                    { 
    1760                         /* auto activation */ /** @todo do this manually in the future, ditto for setting the MAC address. */ 
    1761                         rc = intnetR0IfSetActive(pIf, true /* activate */); 
    1762                         AssertRC(rc); 
    1763  
    17641760                        *phIf = pIf->hIf; 
    17651761                        Log(("intnetR0NetworkCreateIf: returns VINF_SUCCESS *phIf=%p cbSend=%u cbRecv=%u cbBuf=%u\n", 
  • trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp

    r10806 r10846  
    807807            { 
    808808                /* 
    809                  * Start the stop watch, init the pcap file. 
     809                 * Activate the interface. 
    810810                 */ 
    811                 g_StartTS = RTTimeNanoTS(); 
    812                 if (pFileRaw) 
    813                     PcapStreamHdr(pFileRaw, g_StartTS); 
    814  
    815                 /* 
    816                  * Do the transmit test first and so we can sniff for the response. 
    817                  */ 
    818                 if (fXmitTest) 
    819                     doXmitText(OpenReq.hIf, pSession, pBuf, &SrcMac, pFileRaw); 
    820  
    821                 /* 
    822                  * Either enter sniffing mode or do a timeout thing. 
    823                  */ 
    824                 if (fSniffer) 
     811                INTNETIFSETACTIVEREQ ActiveReq; 
     812                ActiveReq.Hdr.u32Magic = SUPVMMR0REQHDR_MAGIC; 
     813                ActiveReq.Hdr.cbReq = sizeof(ActiveReq); 
     814                ActiveReq.pSession = pSession; 
     815                ActiveReq.hIf = OpenReq.hIf; 
     816                ActiveReq.fActive = true; 
     817                rc = SUPCallVMMR0Ex(NIL_RTR0PTR, VMMR0_DO_INTNET_IF_SET_ACTIVE, 0, &ActiveReq.Hdr); 
     818                if (RT_SUCCESS(rc)) 
    825819                { 
    826                     doPacketSniffing(OpenReq.hIf, pSession, pBuf, cMillies, pFileRaw, pFileText, &SrcMac); 
    827                     if (fXmitTest != g_fDhcpReply) 
     820                    /* 
     821                     * Start the stop watch, init the pcap file. 
     822                     */ 
     823                    g_StartTS = RTTimeNanoTS(); 
     824                    if (pFileRaw) 
     825                        PcapStreamHdr(pFileRaw, g_StartTS); 
     826 
     827                    /* 
     828                     * Do the transmit test first and so we can sniff for the response. 
     829                     */ 
     830                    if (fXmitTest) 
     831                        doXmitText(OpenReq.hIf, pSession, pBuf, &SrcMac, pFileRaw); 
     832 
     833                    /* 
     834                     * Either enter sniffing mode or do a timeout thing. 
     835                     */ 
     836                    if (fSniffer) 
    828837                    { 
    829                         RTPrintf("tstIntNet-1: Error! The DHCP server didn't reply... (Perhaps you don't have one?)\n", rc); 
    830                         g_cErrors++; 
     838                        doPacketSniffing(OpenReq.hIf, pSession, pBuf, cMillies, pFileRaw, pFileText, &SrcMac); 
     839                        if (fXmitTest != g_fDhcpReply) 
     840                        { 
     841                            RTPrintf("tstIntNet-1: Error! The DHCP server didn't reply... (Perhaps you don't have one?)\n", rc); 
     842                            g_cErrors++; 
     843                        } 
    831844                    } 
     845                    else 
     846                        RTThreadSleep(cMillies); 
    832847                } 
    833848                else 
    834                     RTThreadSleep(cMillies); 
     849                { 
     850                    RTPrintf("tstIntNet-1: SUPCallVMMR0Ex(,VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE,) failed, rc=%Rrc\n", rc); 
     851                    g_cErrors++; 
     852                } 
    835853            } 
    836854            else 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy