VirtualBox

Ignore:
Timestamp:
Apr 22, 2015 9:34:46 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99701
Message:

NetworkServices: When handling COM/XPCOM events, always check if the event is for our network, otherwise ignore the event. Renamed {get/set}Network to {get/set}NetworkName(). Renamed {get/set}Name to {get/set}ServiceName(). Use RT_ZERO instead of memset if possible. Coding style.

Location:
trunk/src/VBox/NetworkServices/DHCP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/DHCP/NetworkManagerDhcp.cpp

    r49735 r55365  
    5555{
    5656    RawOption opt;
    57     memset(&opt, 0, sizeof(RawOption));
     57    RT_ZERO(opt);
     58
    5859    /* 1. Find client */
    5960    ConfigurationManager *confManager = ConfigurationManager::getConfigurationManager();
  • trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp

    r54700 r55365  
    221221    m_cbCurMsg              = 0;
    222222    m_pCurMsg               = NULL;
    223     memset(&m_CurHdrs, '\0', sizeof(m_CurHdrs));
     223    RT_ZERO(m_CurHdrs);
    224224
    225225    m_fIgnoreCmdLineParameters = true;
     
    499499     */
    500500    AssertRCReturn(virtualbox.isNull(), VERR_INTERNAL_ERROR);
    501     std::string networkName = getNetwork();
     501    std::string networkName = getNetworkName();
    502502
    503503    int rc = findDhcpServer(virtualbox, networkName, m_DhcpServer);
     
    616616        {
    617617            ComPtr <INATNetworkStartStopEvent> pStartStopEvent = pEvent;
     618
     619            com::Bstr networkName;
     620            HRESULT hrc = pStartStopEvent->COMGETTER(NetworkName)(networkName.asOutParam());
     621            AssertComRCReturn(hrc, hrc);
     622            if (networkName.compare(getNetworkName().c_str()))
     623                break; /* change not for our network */
     624
    618625            BOOL fStart = TRUE;
    619             HRESULT hrc = pStartStopEvent->COMGETTER(StartEvent)(&fStart);
     626            hrc = pStartStopEvent->COMGETTER(StartEvent)(&fStart);
     627            AssertComRCReturn(hrc, hrc);
    620628            if (!fStart)
    621629                shutdown();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette