VirtualBox

Changeset 57576 in vbox for trunk


Ignore:
Timestamp:
Aug 28, 2015 10:53:56 AM (9 years ago)
Author:
vboxsync
Message:

NetFlt/Win: do not restart netlwf filter when VM changes state (#8009)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp

    r56592 r57576  
    1717
    1818//#define VBOXNETLWF_SYNC_SEND
    19 #define VBOXNETLWF_NO_BYPASS
    2019
    2120#include <VBox/version.h>
     
    10099//FILTER_CANCEL_OID_REQUEST vboxNetLwfWinCancelOidRequest;
    101100FILTER_STATUS vboxNetLwfWinStatus;
    102 FILTER_SET_MODULE_OPTIONS vboxNetLwfWinSetModuleOptions;
    103101//FILTER_NET_PNP_EVENT vboxNetLwfWinPnPEvent;
    104102FILTER_SEND_NET_BUFFER_LISTS vboxNetLwfWinSendNetBufferLists;
     
    14271425    LogFlow(("==>vboxNetLwfWinSendNetBufferLists: module=%p\n", hModuleCtx));
    14281426    PVBOXNETLWF_MODULE pModule = (PVBOXNETLWF_MODULE)hModuleCtx;
    1429 #ifdef VBOXNETLWF_NO_BYPASS
     1427
    14301428    if (!ASMAtomicReadBool(&pModule->fActive))
    14311429    {
     
    14371435        return;
    14381436    }
    1439 #endif
     1437
    14401438    if (vboxNetLwfWinIsRunning(pModule))
    14411439    {
     
    15621560    LogFlow(("==>vboxNetLwfWinReceiveNetBufferLists: module=%p\n", hModuleCtx));
    15631561    PVBOXNETLWF_MODULE pModule = (PVBOXNETLWF_MODULE)hModuleCtx;
    1564 #ifdef VBOXNETLWF_NO_BYPASS
     1562
    15651563    if (!ASMAtomicReadBool(&pModule->fActive))
    15661564    {
     
    15731571        return;
    15741572    }
    1575 #endif
     1573
    15761574    if (vboxNetLwfWinIsRunning(pModule))
    15771575    {
     
    17191717}
    17201718
    1721 NDIS_STATUS vboxNetLwfWinSetModuleOptions(IN NDIS_HANDLE hModuleCtx)
    1722 {
    1723     LogFlow(("==>vboxNetLwfWinSetModuleOptions: module=%p\n", hModuleCtx));
    1724     PVBOXNETLWF_MODULE pModuleCtx = (PVBOXNETLWF_MODULE)hModuleCtx;
    1725     NDIS_FILTER_PARTIAL_CHARACTERISTICS PChars;
    1726 
    1727     NdisZeroMemory(&PChars, sizeof(PChars));
    1728 
    1729     PChars.Header.Type = NDIS_OBJECT_TYPE_FILTER_PARTIAL_CHARACTERISTICS;
    1730     PChars.Header.Size = NDIS_SIZEOF_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1;
    1731     PChars.Header.Revision = NDIS_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1;
    1732 
    1733 #ifndef VBOXNETLWF_NO_BYPASS
    1734     if (ASMAtomicReadBool(&pModuleCtx->fActive))
    1735 #endif
    1736     {
    1737         Log(("vboxNetLwfWinSetModuleOptions: active mode\n"));
    1738         PChars.SendNetBufferListsHandler = vboxNetLwfWinSendNetBufferLists;
    1739         PChars.SendNetBufferListsCompleteHandler = vboxNetLwfWinSendNetBufferListsComplete;
    1740         PChars.ReceiveNetBufferListsHandler = vboxNetLwfWinReceiveNetBufferLists;
    1741         PChars.ReturnNetBufferListsHandler = vboxNetLwfWinReturnNetBufferLists;
    1742     }
    1743 #ifndef VBOXNETLWF_NO_BYPASS
    1744     else
    1745     {
    1746         Log(("vboxNetLwfWinSetModuleOptions: bypass mode\n"));
    1747     }
    1748 #endif
    1749     NDIS_STATUS Status = NdisSetOptionalHandlers(pModuleCtx->hFilter,
    1750                                                  (PNDIS_DRIVER_OPTIONAL_HANDLERS)&PChars);
    1751     LogFlow(("<==vboxNetLwfWinSetModuleOptions: status=0x%x\n", Status));
    1752     return Status;
    1753 }
    1754 
    17551719/**
    17561720 * register the filter driver
     
    17921756    FChars.StatusHandler = vboxNetLwfWinStatus;
    17931757    //FChars.NetPnPEventHandler = vboxNetLwfWinPnPEvent;
    1794     FChars.SetFilterModuleOptionsHandler = vboxNetLwfWinSetModuleOptions;
    1795 
    1796     /* Optional functions */
     1758
     1759    /* Datapath functions */
    17971760    FChars.SendNetBufferListsHandler = vboxNetLwfWinSendNetBufferLists;
    17981761    FChars.SendNetBufferListsCompleteHandler = vboxNetLwfWinSendNetBufferListsComplete;
     
    21632126    if (fOldActive != fActive)
    21642127    {
    2165         /// @todo Shouldn't we wait for traffic to cease here? Probably not.
    2166         /* Schedule restart to enable/disable bypass mode */
    2167         NdisFRestartFilter(pModuleCtx->hFilter);
    21682128        Status = vboxNetLwfWinSetPacketFilter(pModuleCtx, fActive);
    21692129        LogFlow(("<==vboxNetFltPortOsSetActive: vboxNetLwfWinSetPacketFilter() returned 0x%x\n", Status));
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