Changeset 50672 in vbox
- Timestamp:
- Mar 4, 2014 1:34:15 AM (11 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r50156 r50672 42 42 */ 43 43 #include <slirp.h> 44 #include <libslirp.h> 44 45 45 46 /** Entry in the table of known DHCP clients. */ … … 698 699 * within transaction), assuming that transaction can't be longer than 1 min. 699 700 * 701 * @note: if we have notification update (HAVE_NOTIFICATION_FOR_DNS_UPDATE) 702 * provided by host, we don't need implicitly re-initialize dns list. 703 * 700 704 * @note: NATState::fUseHostResolver became (r89055) the flag signalling that Slirp 701 705 * wasn't able to fetch fresh host DNS info and fall down to use host-resolver, on one … … 705 709 * wanted by user ASAP (P here when host serialize its configuration in files parsed by Slirp). 706 710 */ 707 if ( !pData->fUseHostResolverPermanent 711 if ( !HAVE_NOTIFICATION_FOR_DNS_UPDATE 712 && !pData->fUseHostResolverPermanent 708 713 && ( pData->dnsLastUpdate == 0 709 714 || curtime - pData->dnsLastUpdate > 60 * 1000 /* one minute */ … … 716 721 if (parameter_list[i] == RFC1533_DNS) 717 722 { 723 /* XXX: How differs it from host Suspend/Resume? */ 718 724 slirpReleaseDnsSettings(pData); 719 725 slirpInitializeDnsSettings(pData); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r50669 r50672 64 64 65 65 #ifndef RT_OS_WINDOWS 66 66 /** 67 * XXX: It shouldn't be non-Windows specific. 68 * resolv_conf_parser.h client's structure isn't OS specific, it's just need to be generalized a 69 * a bit to replace slirp_state.h DNS server (domain) lists with rcp_state like structure. 70 */ 71 # include "resolv_conf_parser.h" 72 #endif 73 74 #ifndef RT_OS_WINDOWS 67 75 # define DO_ENGAGE_EVENT1(so, fdset, label) \ 68 76 do { \ … … 2039 2047 } 2040 2048 2041 2049 /** 2050 * @note: NATState::fUseHostResolver could be changed in bootp.c::dhcp_decode 2051 * @note: this function is executed on GUI/VirtualBox or main/VBoxHeadless thread. 2052 * @note: this function can potentially race with bootp.c::dhcp_decode (except Darwin) 2053 */ 2042 2054 int slirp_host_network_configuration_change_strategy_selector(const PNATState pData) 2043 2055 { 2044 if (pData->fUseHostResolver) return VBOX_NAT_HNCE_HOSTRESOLVER; 2045 if (pData->fUseDnsProxy) return VBOX_NAT_HNCE_DNSPROXY; 2056 if (pData->fUseHostResolverPermanent) return VBOX_NAT_HNCE_HOSTRESOLVER; 2057 if (pData->fUseDnsProxy) { 2058 #if HAVE_NOTIFICATION_FOR_DNS_UPDATE 2059 /* We dont conflict with bootp.c::dhcp_decode */ 2060 struct rcp_state rcp_state; 2061 int rc; 2062 2063 rcp_state.rcps_flags |= RCPSF_IGNORE_IPV6; 2064 rc = rcp_parse(&rcp_state, RESOLV_CONF_FILE); 2065 LogRelFunc(("NAT: rcp_parse:%Rrc old domain:%s new domain:%s\n", 2066 rc, LIST_FIRST(&pData->pDomainList)->dd_pszDomain, 2067 rcp_state.rcps_domain)); 2068 if ( RT_FAILURE(rc) 2069 || LIST_EMPTY(&pData->pDomainList)) 2070 return VBOX_NAT_HNCE_DNSPROXY; 2071 2072 if ( rcp_state.rcps_domain 2073 && strcmp(rcp_state.rcps_domain, LIST_FIRST(&pData->pDomainList)->dd_pszDomain) == 0) 2074 return VBOX_NAT_HNCE_DNSPROXY; 2075 else 2076 return VBOX_NAT_HNCE_EXSPOSED_NAME_RESOLUTION_INFO; /* XXX: rename it */ 2077 #else 2078 /* copy domain name */ 2079 /* domain only compare with coy version */ 2080 return VBOX_NAT_HNCE_DNSPROXY; 2081 #endif 2082 } 2046 2083 return VBOX_NAT_HNCE_EXSPOSED_NAME_RESOLUTION_INFO; 2047 2084 }
Note:
See TracChangeset
for help on using the changeset viewer.