VirtualBox

Changeset 92108 in vbox


Ignore:
Timestamp:
Oct 27, 2021 2:54:48 PM (3 years ago)
Author:
vboxsync
Message:

Devics/Network/slirp: Switch to the DNS proxy in case the local resolv.conf contains the loopback interface as the nameserver when access to the loopback interface is blocked, bugref:9896

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/slirp_dns.c

    r82968 r92108  
    198198             * because DNS proxy we do revert it back actually.
    199199             */
    200             if (address->IPv4.u == RT_N2H_U32_C(INADDR_LOOPBACK))
     200            if (   address->IPv4.u == RT_N2H_U32_C(INADDR_LOOPBACK)
     201                && pData->fLocalhostReachable)
    201202                address->IPv4.u = RT_H2N_U32(RT_N2H_U32(pData->special_addr.s_addr) | CTL_ALIAS);
    202203            else if (pData->fUseDnsProxy == 0) {
    203                 /* We detects that using some address in 127/8 network */
    204                 LogRel(("NAT: DNS server %RTnaipv4 registration detected, switching to the DNS proxy\n", address->IPv4));
     204                /*
     205                 * Either the resolver lives somewhere else on the 127/8 network or the loopback interface
     206                 * is blocked for access from the guest, either way switch to the DNS proxy.
     207                 */
     208                if (pData->fLocalhostReachable)
     209                    LogRel(("NAT: DNS server %RTnaipv4 registration detected, switching to the DNS proxy\n", address->IPv4));
     210                else
     211                    LogRel(("NAT: Switching to DNS proxying due to access to the loopback interface being blocked\n"));
    205212                pData->fUseDnsProxy = 1;
    206213            }
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