VirtualBox

Changeset 71203 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 5, 2018 3:47:29 PM (7 years ago)
Author:
vboxsync
Message:

NAT: Redo previous. Explicitly map nameserver 0.0.0.0 to loopback
first and let existing code remap it instead of duplicating that code.

File:
1 edited

Legend:

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

    r71202 r71203  
    179179        struct dns_entry *pDns;
    180180        RTNETADDRU *address = &st.rcps_nameserver[i].uAddr;
     181
     182        if (address->IPv4.u == INADDR_ANY)
     183        {
     184            /*
     185             * This doesn't seem to be very well documented except for
     186             * RTFS of res_init.c, but INADDR_ANY is a valid value for
     187             * for "nameserver".
     188             */
     189            address->IPv4.u = RT_H2N_U32_C(INADDR_LOOPBACK);
     190        }
     191
    181192        if (  (address->IPv4.u & RT_H2N_U32_C(IN_CLASSA_NET))
    182193           == RT_N2H_U32_C(INADDR_LOOPBACK & IN_CLASSA_NET))
     
    194205            }
    195206        }
    196         else if (address->IPv4.u == INADDR_ANY)
    197         {
    198             /*
    199              * This doesn't seem to be very well documented except for
    200              * RTFS of res_init.c, but INADDR_ANY is a valid value for
    201              * for "nameserver".
    202              */
    203             address->IPv4.u = pData->special_addr.s_addr | RT_H2N_U32_C(CTL_ALIAS);
    204         }
    205207
    206208        pDns = RTMemAllocZ(sizeof(struct dns_entry));
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