VirtualBox

Changeset 50950 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 2, 2014 1:32:02 AM (11 years ago)
Author:
vboxsync
Message:

NAT: Rename fHostNetworkConfigurationEventListener parameter to fFlapLink.
drvNATHostNetworkConfigurationChangeEventStrategySelector is called
with it set to true not only for the (MacOS) event. I can see how it
is intended to eventually signal the fact that DNS information *has*
changed, but then it wouldn't make sense to do anything if it hadn't.
So use the name that better describes current reallity and deal with
the future in the future.

File:
1 edited

Legend:

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

    r50949 r50950  
    223223DECLINLINE(void) drvNATHostNetworkConfigurationChangeEventStrategySelector(
    224224  PDRVNAT pThis,
    225   bool fHostNetworkConfigurationEventListener);
     225  bool fFlapLink);
    226226static DECLCALLBACK(int) drvNATReinitializeHostNameResolving(PDRVNAT pThis);
    227227
     
    979979        CFArrayRef hArrAddresses = (CFArrayRef)CFDictionaryGetValue(hDnsDict, kSCPropNetDNSServerAddresses);
    980980        if (hArrAddresses)
    981             drvNATHostNetworkConfigurationChangeEventStrategySelector(pThis, /* RT_OS_DARWIN */ true);
     981            drvNATHostNetworkConfigurationChangeEventStrategySelector(pThis, /* fFlapLink */ true);
    982982
    983983        CFRelease(hDnsDict);
     
    10521052    {
    10531053        case VMRESUMEREASON_HOST_RESUME:
     1054            bool fFlapLink;
    10541055#if RT_OS_DARWIN
    1055             drvNATHostNetworkConfigurationChangeEventStrategySelector(pThis, false);
     1056            /* let drvNatDnsChanged event handler do it if necessary */
     1057            fFlapLink = false;
    10561058#else
    1057             drvNATHostNetworkConfigurationChangeEventStrategySelector(pThis, true);
    1058 #endif
     1059            /* XXX: when in doubt, use brute force */
     1060            fFlapLink = true;
     1061#endif
     1062            drvNATHostNetworkConfigurationChangeEventStrategySelector(pThis, fFlapLink);
    10591063            return;
    10601064        default: /* Ignore every other resume reason. */
     
    10831087 * search string) at runtime (VBOX_NAT_ENFORCE_INTERNAL_DNS_UPDATE), we can do it safely on NAT thread,
    10841088 * so with changing other variables (place where we handle update) the main mechanism of update
    1085  * _won't_ be changed, the only thing will change is drop of fHostNetworkConfigurationEventListener parameter.
     1089 * _won't_ be changed, the only thing will change is drop of fFlapLink parameter.
    10861090 */
    10871091DECLINLINE(void) drvNATHostNetworkConfigurationChangeEventStrategySelector(PDRVNAT pThis,
    1088                                                                         bool fHostNetworkConfigurationEventListener)
     1092                                                                        bool fFlapLink)
    10891093{
    10901094    int strategy = slirp_host_network_configuration_change_strategy_selector(pThis->pNATState);
     
    11221126             */
    11231127
    1124             if (fHostNetworkConfigurationEventListener)
     1128            if (fFlapLink)
    11251129                pThis->pIAboveConfig->pfnSetLinkState(pThis->pIAboveConfig,
    11261130                                                      PDMNETWORKLINKSTATE_DOWN_RESUME);
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