VirtualBox

Changeset 54109 in vbox for trunk


Ignore:
Timestamp:
Feb 8, 2015 11:03:56 PM (10 years ago)
Author:
vboxsync
Message:

NAT: Use PDMINETWORKNATCONFIG::pfnNotifyDnsChanged callback if
HAVE_NOTIFICATION_FOR_DNS_UPDATE is enabled - except on OS X, where
for now we still use old OS X specific notifications, so this should
be no-op on OS X. Since HAVE_NOTIFICATION_FOR_DNS_UPDATE is not
enabled for anything but OS X for now, this, for now, is a no-op
elsewhere too. But just enabling HAVE_NOTIFICATION_FOR_DNS_UPDATE in
libslirp.h should now be enough to switch.

File:
1 edited

Legend:

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

    r54107 r54109  
    959959
    960960
     961/**
     962 * @interface_method_impl{PDMINETWORKNATCONFIG,pfnNotifyDnsChanged}
     963 *
     964 * We are notified that host's resolver configuration has changed.  In
     965 * the current setup we don't get any details and just reread that
     966 * information ourselves.
     967 */
     968static DECLCALLBACK(void) drvNATNotifyDnsChanged(PPDMINETWORKNATCONFIG pInterface)
     969{
     970    PDRVNAT pThis = RT_FROM_MEMBER(pInterface, DRVNAT, INetworkNATCfg);
     971    drvNATUpdateDNS(pThis, /* fFlapLink */ true);
     972}
     973
     974
    961975#ifdef RT_OS_DARWIN
    962976/**
     
    10851099        case VMRESUMEREASON_HOST_RESUME:
    10861100            bool fFlapLink;
    1087 #if RT_OS_DARWIN
    1088             /* let drvNatDnsChanged event handler do it if necessary */
     1101#if HAVE_NOTIFICATION_FOR_DNS_UPDATE
     1102            /* let event handler do it if necessary */
    10891103            fFlapLink = false;
    10901104#else
     
    14051419    /* NAT engine configuration */
    14061420    pThis->INetworkNATCfg.pfnRedirectRuleCommand = drvNATNetworkNatConfig_RedirectRuleCommand;
     1421#if HAVE_NOTIFICATION_FOR_DNS_UPDATE && !defined(RT_OS_DARWIN)
     1422    /*
     1423     * On OS X we stick to the old OS X specific notifications for
     1424     * now.  Elsewhere use IHostNameResolutionConfigurationChangeEvent
     1425     * by enbaling HAVE_NOTIFICATION_FOR_DNS_UPDATE in libslirp.h.
     1426     * This code is still in a bit of flux and is implemented and
     1427     * enabled in steps to simplify more conservative backporting.
     1428     */
     1429    pThis->INetworkNATCfg.pfnNotifyDnsChanged = drvNATNotifyDnsChanged;
     1430#else
    14071431    pThis->INetworkNATCfg.pfnNotifyDnsChanged = NULL;
     1432#endif
    14081433
    14091434    /*
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