- Timestamp:
- Jun 26, 2009 7:50:03 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r20958 r20959 722 722 Network/slirp/tcp_timer.c \ 723 723 Network/slirp/tftp.c \ 724 Network/slirp/udp.c 724 Network/slirp/udp.c \ 725 Network/slirp/dnsproxy/hash.c \ 726 Network/slirp/dnsproxy/dnsproxy.c 725 727 726 728 VBOX_SLIRP_ALIAS_SOURCES = \ … … 733 735 Network/slirp/libalias/alias_util.c 734 736 735 736 VBOX_WITH_SLIRP_DNS_PROXY=1737 738 ifdef VBOX_WITH_SLIRP_DNS_PROXY739 VBOX_SLIRP_SOURCES += \740 Network/slirp/dnsproxy/hash.c \741 Network/slirp/dnsproxy/dnsproxy.c742 endif743 744 737 # some day will be deleted 745 VBOX_WITH_MULTI_DNS=1746 738 VBOX_WITHOUT_SLIRP_CLIENT_ETHER=1 747 739 … … 753 745 $(if $(VBOX_WITHOUT_SLIRP_CLIENT_ETHER),VBOX_WITHOUT_SLIRP_CLIENT_ETHER,) \ 754 746 $(if $(VBOX_WITH_DEBUG_NAT_SOCKETS),VBOX_WITH_DEBUG_NAT_SOCKETS,) \ 755 $(if $(VBOX_WITH_MULTI_DNS),VBOX_WITH_MULTI_DNS,) \756 $(if $(VBOX_WITH_SLIRP_DNS_PROXY),VBOX_WITH_SLIRP_DNS_PROXY,) \757 747 $(if $(VBOX_WITH_SLIRP_MT),VBOX_WITH_SLIRP_MT,) 758 748 ifdef VBOX_WITH_SLIRP_ALIAS -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r20718 r20959 751 751 * Validate the config. 752 752 */ 753 if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0" 754 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 755 "DNSProxy\0" 756 #endif 753 if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0DNSProxy\0" 757 754 "SocketRcvBuf\0SocketSndBuf\0TcpRcvSpace\0TcpSndSpace\0")) 758 755 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, … … 793 790 if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND) 794 791 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"NextServer\" string failed"), pDrvIns->iInstance); 795 #ifdef VBOX_WITH_SLIRP_DNS_PROXY796 792 int fDNSProxy; 797 793 rc = CFGMR3QueryS32(pCfgHandle, "DNSProxy", &fDNSProxy); 798 794 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 799 795 fDNSProxy = 0; 800 #endif801 796 802 797 /* … … 837 832 slirp_set_dhcp_TFTP_bootfile(pThis->pNATState, pThis->pszBootFile); 838 833 slirp_set_dhcp_next_server(pThis->pNATState, pThis->pszNextServer); 839 #ifdef VBOX_WITH_SLIRP_DNS_PROXY840 834 slirp_set_dhcp_dns_proxy(pThis->pNATState, !!fDNSProxy); 841 #endif842 835 #define SLIRP_SET_TUNING_VALUE(name, setter) \ 843 836 do \ -
trunk/src/VBox/Devices/Network/slirp/bootp.c
r19981 r20959 144 144 struct bootp_t *rbp; 145 145 struct sockaddr_in saddr, daddr; 146 #ifndef VBOX_WITH_MULTI_DNS147 struct in_addr dns_addr_dhcp;148 #endif149 146 int dhcp_msg_type, val; 150 147 uint8_t *q; … … 305 302 || dhcp_msg_type == DHCPREQUEST)) 306 303 { 307 #ifdef VBOX_WITH_MULTI_DNS308 304 struct dns_entry *de = NULL; 309 305 struct dns_domain_entry *dd = NULL; 310 306 int added = 0; 311 307 uint8_t *q_dns_header = NULL; 312 #endif313 308 uint32_t lease_time = htonl(LEASE_TIME); 314 309 uint32_t netmask = htonl(pData->netmask); … … 317 312 FILL_BOOTP_EXT(q, RFC1533_GATEWAY, 4, &saddr.sin_addr); 318 313 319 #ifndef VBOX_WITH_MULTI_DNS320 dns_addr_dhcp.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_DNS);321 FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &dns_addr_dhcp.s_addr);322 #else323 # ifdef VBOX_WITH_SLIRP_DNS_PROXY324 314 if (pData->use_dns_proxy) 325 315 { … … 328 318 goto skip_dns_servers; 329 319 } 330 # endif331 332 320 333 321 if (!TAILQ_EMPTY(&pData->dns_list_head)) … … 345 333 } 346 334 347 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 348 skip_dns_servers: 349 #endif 335 skip_dns_servers: 350 336 if (LIST_EMPTY(&pData->dns_domain_list_head)) 351 337 { … … 366 352 FILL_BOOTP_EXT(q, RFC1533_DOMAINNAME, val, dd->dd_pszDomain); 367 353 } 368 #endif369 354 370 355 FILL_BOOTP_EXT(q, RFC2132_LEASE_TIME, 4, &lease_time); … … 375 360 FILL_BOOTP_EXT(q, RFC1533_HOSTNAME, val, slirp_hostname); 376 361 } 377 378 #ifndef VBOX_WITH_MULTI_DNS379 if (pData->pszDomain && pData->fPassDomain)380 {381 val = (int)strlen(pData->pszDomain);382 FILL_BOOTP_EXT(q, RFC1533_DOMAINNAME, val, pData->pszDomain);383 }384 #endif385 362 } 386 363 *q++ = RFC1533_END; -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r20257 r20959 103 103 pData->pfIcmpCloseHandle = (BOOL (WINAPI *)(HANDLE)) 104 104 GetProcAddress(pData->hmIcmpLibrary, "IcmpCloseHandle"); 105 # ifdef VBOX_WITH_MULTI_DNS106 105 pData->pfGetAdaptersAddresses = (ULONG (WINAPI *)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG)) 107 106 GetProcAddress(pData->hmIcmpLibrary, "GetAdaptersAddresses"); … … 110 109 LogRel(("NAT: Can't find GetAdapterAddresses in Iphlpapi.dll")); 111 110 } 112 # endif113 111 } 114 112 115 113 if (pData->pfIcmpParseReplies == NULL) 116 114 { 117 # ifdef VBOX_WITH_MULTI_DNS118 115 if(pData->pfGetAdaptersAddresses == NULL) 119 116 FreeLibrary(pData->hmIcmpLibrary); 120 # else121 FreeLibrary(pData->hmIcmpLibrary);122 # endif123 117 pData->hmIcmpLibrary = LoadLibrary("Icmp.dll"); 124 118 if (pData->hmIcmpLibrary == NULL) … … 371 365 { 372 366 case CTL_DNS: 373 #ifndef VBOX_WITH_MULTI_DNS374 addr.sin_addr = dns_addr;375 break;376 #endif377 367 case CTL_ALIAS: 378 368 default: -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r20712 r20959 64 64 void slirp_set_dhcp_TFTP_bootfile(PNATState pData, const char *bootFile); 65 65 void slirp_set_dhcp_next_server(PNATState pData, const char *nextServer); 66 #ifdef VBOX_WITH_SLIRP_DNS_PROXY67 66 void slirp_set_dhcp_dns_proxy(PNATState pData, bool fDNSProxy); 68 #endif69 67 void slirp_set_rcvbuf(PNATState pData, int kilobytes); 70 68 void slirp_set_sndbuf(PNATState pData, int kilobytes); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r20782 r20959 2 2 #ifdef RT_OS_OS2 3 3 # include <paths.h> 4 #endif5 #ifdef VBOX_WITH_SLIRP_DNS_PROXY6 #include "dnsproxy/dnsproxy.h"7 4 #endif 8 5 … … 210 207 211 208 #ifdef RT_OS_WINDOWS 212 # ifndef VBOX_WITH_MULTI_DNS213 static int get_dns_addr_domain(PNATState pData, bool fVerbose,214 struct in_addr *pdns_addr,215 const char **ppszDomain)216 {217 int rc = 0;218 FIXED_INFO *FixedInfo = NULL;219 ULONG BufLen;220 DWORD ret;221 IP_ADDR_STRING *pIPAddr;222 struct in_addr tmp_addr;223 224 FixedInfo = (FIXED_INFO *)GlobalAlloc(GPTR, sizeof(FIXED_INFO));225 BufLen = sizeof(FIXED_INFO);226 227 /** @todo: this API returns all DNS servers, no matter whether the228 * corresponding network adapter is disabled or not. Maybe replace229 * this by GetAdapterAddresses(), which is XP/Vista only though. */230 if (ERROR_BUFFER_OVERFLOW == GetNetworkParams(FixedInfo, &BufLen))231 {232 if (FixedInfo)233 {234 GlobalFree(FixedInfo);235 FixedInfo = NULL;236 }237 FixedInfo = GlobalAlloc(GPTR, BufLen);238 }239 240 if ((ret = GetNetworkParams(FixedInfo, &BufLen)) != ERROR_SUCCESS)241 {242 Log(("GetNetworkParams failed. ret = %08x\n", (u_int)ret ));243 if (FixedInfo)244 {245 GlobalFree(FixedInfo);246 FixedInfo = NULL;247 }248 rc = -1;249 goto get_dns_prefix;250 }251 252 pIPAddr = &(FixedInfo->DnsServerList);253 inet_aton(pIPAddr->IpAddress.String, &tmp_addr);254 Log(("nat: DNS Servers:\n"));255 if (fVerbose || pdns_addr->s_addr != tmp_addr.s_addr)256 LogRel(("NAT: DNS address: %s\n", pIPAddr->IpAddress.String));257 *pdns_addr = tmp_addr;258 259 pIPAddr = FixedInfo -> DnsServerList.Next;260 while (pIPAddr)261 {262 if (fVerbose)263 LogRel(("NAT: ignored DNS address: %s\n", pIPAddr ->IpAddress.String));264 pIPAddr = pIPAddr ->Next;265 }266 if (FixedInfo)267 {268 GlobalFree(FixedInfo);269 FixedInfo = NULL;270 }271 272 get_dns_prefix:273 if (ppszDomain)274 {275 OSVERSIONINFO ver;276 char szDnsDomain[256];277 DWORD dwSize = sizeof(szDnsDomain);278 279 *ppszDomain = NULL;280 GetVersionEx(&ver);281 if (ver.dwMajorVersion >= 5)282 {283 /* GetComputerNameEx exists in Windows versions starting with 2000. */284 if (GetComputerNameEx(ComputerNameDnsDomain, szDnsDomain, &dwSize))285 {286 if (szDnsDomain[0])287 {288 /* Just non-empty strings are valid. */289 *ppszDomain = RTStrDup(szDnsDomain);290 if (pData->fPassDomain)291 {292 if (fVerbose)293 LogRel(("NAT: passing domain name %s\n", szDnsDomain));294 }295 else296 Log(("nat: ignoring domain %s\n", szDnsDomain));297 }298 }299 else300 Log(("nat: GetComputerNameEx failed (%d)\n", GetLastError()));301 }302 }303 return rc;304 }305 # else /* !VBOX_WITH_MULTI_DNS */306 209 static int get_dns_addr_domain(PNATState pData, bool fVerbose, 307 210 struct in_addr *pdns_addr, … … 424 327 return 0; 425 328 } 426 # endif /* VBOX_WITH_MULTI_DNS */427 329 428 330 #else /* !RT_OS_WINDOWS */ … … 482 384 while (fgets(buff, 512, f) != NULL) 483 385 { 484 #ifdef VBOX_WITH_MULTI_DNS485 386 struct dns_entry *da = NULL; 486 #endif487 387 if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) 488 388 { 489 389 if (!inet_aton(buff2, &tmp_addr)) 490 390 continue; 491 #ifndef VBOX_WITH_MULTI_DNS 492 /* If it's the first one, set it to dns_addr */ 493 if (!found) 494 { 495 if (fVerbose || pdns_addr->s_addr != tmp_addr.s_addr) 496 LogRel(("NAT: DNS address: %s\n", buff2)); 497 *pdns_addr = tmp_addr; 498 } 499 else 500 { 501 if (fVerbose) 502 LogRel(("NAT: ignored DNS address: %s\n", buff2)); 503 } 504 #else 505 /*localhost mask */ 391 /*localhost mask */ 506 392 da = RTMemAllocZ(sizeof (struct dns_entry)); 507 393 if (da == NULL) … … 516 402 } 517 403 TAILQ_INSERT_HEAD(&pData->dns_list_head, da, de_list); 518 #endif519 404 found++; 520 405 } 521 #ifndef VBOX_WITH_MULTI_DNS522 if ( ppszDomain523 && (!strncmp(buff, "domain", 6) || !strncmp(buff, "search", 6)))524 {525 /* Domain name/search list present. Pick first entry */526 if (*ppszDomain == NULL)527 {528 char *tok;529 char *saveptr;530 tok = strtok_r(&buff[6], " \t\n", &saveptr);531 if (tok)532 {533 *ppszDomain = RTStrDup(tok);534 if (pData->fPassDomain)535 {536 if (fVerbose)537 LogRel(("NAT: passing domain name %s\n", tok));538 }539 else540 Log(("nat: ignoring domain %s\n", tok));541 }542 }543 }544 #else545 406 if ((!strncmp(buff, "domain", 6) || !strncmp(buff, "search", 6))) 546 407 { … … 571 432 } 572 433 } 573 #endif574 434 } 575 435 fclose(f); … … 580 440 581 441 #endif 582 #ifdef VBOX_WITH_MULTI_DNS 442 583 443 static int slirp_init_dns_list(PNATState pData) 584 444 { … … 605 465 } 606 466 } 607 #endif608 467 609 468 int get_dns_addr(PNATState pData, struct in_addr *pdns_addr) … … 676 535 /* set default addresses */ 677 536 inet_aton("127.0.0.1", &loopback_addr); 678 #ifndef VBOX_WITH_MULTI_DNS679 inet_aton("127.0.0.1", &dns_addr);680 681 if (get_dns_addr_domain(pData, true, &dns_addr, &pData->pszDomain) < 0)682 #else683 537 if (slirp_init_dns_list(pData) < 0) 684 #endif685 538 fNATfailed = 1; 686 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 539 687 540 dnsproxy_init(pData); 688 #endif689 541 690 542 getouraddr(pData); … … 795 647 void slirp_term(PNATState pData) 796 648 { 797 #ifndef VBOX_WITH_MULTI_DNS798 if (pData->pszDomain)799 RTStrFree((char *)(void *)pData->pszDomain);800 #endif801 802 649 #ifdef RT_OS_WINDOWS 803 650 pData->pfIcmpCloseHandle(pData->icmp_socket.sh); … … 809 656 810 657 slirp_link_down(pData); 811 #ifdef VBOX_WITH_MULTI_DNS812 658 slirp_release_dns_list(pData); 813 #endif814 659 #ifdef RT_OS_WINDOWS 815 660 WSACleanup(); … … 1002 847 if (so->so_expire <= curtime) 1003 848 { 1004 #ifdef VBOX_WITH_SLIRP_DNS_PROXY1005 849 Log2(("NAT: %R[natsock] expired\n", so)); 1006 850 if (so->so_timeout != NULL) … … 1008 852 so->so_timeout(pData, so, so->so_timeout_arg); 1009 853 } 1010 #endif1011 854 #ifdef VBOX_WITH_SLIRP_MT 1012 855 /* we need so_next for continue our cycle*/ … … 1863 1706 inet_aton(next_server, &pData->tftp_server); 1864 1707 } 1865 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 1708 1866 1709 void slirp_set_dhcp_dns_proxy(PNATState pData, bool fDNSProxy) 1867 1710 { … … 1869 1712 pData->use_dns_proxy = fDNSProxy; 1870 1713 } 1871 #endif1872 1714 1873 1715 #define CHECK_ARG(name, val, lim_min, lim_max) \ -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r20712 r20959 253 253 #endif 254 254 255 #if SIZEOF_CHAR_P == 4256 # define insque_32 insque257 # define remque_32 remque258 #else259 extern void insque_32 (PNATState, void *, void *);260 extern void remque_32 (PNATState, void *);261 #endif262 263 255 #ifndef RT_OS_WINDOWS 264 256 #include <netdb.h> 265 257 #endif 266 258 267 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 268 # include "dnsproxy/dnsproxy.h" 269 #endif 259 #include "dnsproxy/dnsproxy.h" 270 260 271 261 #define DEFAULT_BAUD 115200 … … 337 327 # endif 338 328 #endif 339 340 #ifndef VBOX_WITH_MULTI_DNS341 #define DO_ALIAS(paddr) \342 do { \343 if ((paddr)->s_addr == dns_addr.s_addr) \344 { \345 (paddr)->s_addr = htonl(ntohl(special_addr.s_addr) | CTL_DNS); \346 } \347 } while(0)348 #else349 #define DO_ALIAS(paddr) do {} while (0)350 #endif351 352 329 353 330 # ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r20712 r20959 24 24 #include <iprt/req.h> 25 25 #include "ip_icmp.h" 26 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 27 # include "dnsproxy/dnsproxy.h" 28 #endif 26 #include "dnsproxy/dnsproxy.h" 29 27 30 28 /** Number of DHCP clients supported by NAT. */ … … 60 58 }; 61 59 62 #ifdef VBOX_WITH_MULTI_DNS63 60 struct dns_domain_entry 64 61 { 65 66 62 char *dd_pszDomain; 63 LIST_ENTRY(dns_domain_entry) dd_list; 67 64 }; 68 65 LIST_HEAD(dns_domain_list_head, dns_domain_entry); … … 70 67 struct dns_entry 71 68 { 72 73 69 struct in_addr de_addr; 70 TAILQ_ENTRY(dns_entry) de_list; 74 71 }; 75 72 TAILQ_HEAD(dns_list_head, dns_entry); 76 #endif77 73 78 74 /** Main state/configuration structure for slirp NAT. */ … … 123 119 PRTREQQUEUE pReqQueue; 124 120 #endif 125 #ifndef VBOX_WITH_MULTI_DNS 126 struct in_addr dns_addr; 127 #else 128 # ifdef RT_OS_WINDOWS 121 #ifdef RT_OS_WINDOWS 129 122 ULONG (WINAPI * pfGetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG); 130 # 123 #endif 131 124 struct dns_list_head dns_list_head; 132 125 struct dns_domain_list_head dns_domain_list_head; 133 #endif134 126 struct in_addr tftp_server; 135 127 struct in_addr loopback_addr; … … 143 135 char slirp_hostname[33]; 144 136 bool fPassDomain; 145 #ifndef VBOX_WITH_MULTI_DNS146 const char *pszDomain;147 #endif148 137 /* Stuff from tcp_input.c */ 149 138 struct socket tcb; … … 204 193 HANDLE phEvents[VBOX_EVENT_COUNT]; 205 194 #endif 206 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 195 207 196 /* from dnsproxy/dnsproxy.h*/ 208 197 unsigned int authoritative_port; … … 230 219 int sock_answer; 231 220 /* dnsproxy/hash.c */ 232 # 233 # 221 #define HASHSIZE 10 222 #define HASH(id) (id & ((1 << HASHSIZE) - 1)) 234 223 struct request *request_hash[1 << HASHSIZE]; 235 224 /* this field control behaviour of DHCP server */ 236 225 bool use_dns_proxy; 237 #endif 226 238 227 #ifdef VBOX_WITH_SLIRP_ALIAS 239 228 LIST_HEAD(RT_NOTHING, libalias) instancehead; … … 653 642 #define UDP_DETACH(data, so, so_next) DO_UDP_DETACH((data), (so), (so_next)) 654 643 655 #ifdef VBOX_WITH_SLIRP_DNS_PROXY656 644 /* dnsproxy/dnsproxy.c */ 657 # 658 # 659 # 660 # 661 # 645 #define authoritative_port pData->authoritative_port 646 #define authoritative_timeout pData->authoritative_timeout 647 #define recursive_port pData->recursive_port 648 #define recursive_timeout pData->recursive_timeout 649 #define stats_timeout pData->stats_timeout 662 650 /* dnsproxy/hash.c */ 663 # 664 # 665 # 666 # 667 # 668 # 669 # 670 # 671 # 672 # 673 # 674 # 651 #define dns_port pData->port 652 #define request_hash pData->request_hash 653 #define hash_collisions pData->hash_collisions 654 #define active_queries pData->active_queries 655 #define all_queries pData->all_queries 656 #define authoritative_queries pData->authoritative_queries 657 #define recursive_queries pData->recursive_queries 658 #define removed_queries pData->removed_queries 659 #define dropped_queries pData->dropped_queries 660 #define answered_queries pData->answered_queries 661 #define dropped_answers pData->dropped_answers 662 #define late_answers pData->late_answers 675 663 676 664 /* dnsproxy/dnsproxy.c */ 677 # define queryid pData->queryid 678 # define authoritative_addr pData->authoritative_addr 679 # define recursive_addr pData->recursive_addr 680 # define sock_query pData->sock_query 681 # define sock_answer pData->sock_answer 682 #endif 665 #define queryid pData->queryid 666 #define authoritative_addr pData->authoritative_addr 667 #define recursive_addr pData->recursive_addr 668 #define sock_query pData->sock_query 669 #define sock_answer pData->sock_answer 683 670 684 671 #ifdef VBOX_WITH_SLIRP_ALIAS … … 687 674 688 675 #endif /* !___slirp_state_h */ 689 -
trunk/src/VBox/Devices/Network/slirp/socket.c
r20712 r20959 621 621 * out much quicker (10 seconds for now...) 622 622 */ 623 #ifndef VBOX_WITH_SLIRP_DNS_PROXY624 if (so->so_expire)625 {626 if (so->so_fport == htons(53))627 so->so_expire = curtime + SO_EXPIREFAST;628 else629 so->so_expire = curtime + SO_EXPIRE;630 }631 #else632 623 if (so->so_expire) 633 624 { … … 641 632 if (so->so_fport == htons(53)) 642 633 dnsproxy_answer(pData, so, m); 643 #endif644 634 645 635 #if 0 … … 701 691 #endif 702 692 case CTL_DNS: 703 #ifndef VBOX_WITH_MULTI_DNS704 if (!get_dns_addr(pData, &dns_addr))705 addr.sin_addr = dns_addr;706 else707 addr.sin_addr = loopback_addr;708 break;709 #endif710 693 case CTL_ALIAS: 711 694 default: … … 980 963 { 981 964 ip = &icp->icmp_ip; 982 DO_ALIAS(&ip->ip_dst);983 }984 else985 {986 DO_ALIAS(&ip->ip_src);987 965 } 988 966 … … 1110 1088 ip = mtod(m, struct ip *); 1111 1089 ip->ip_src.s_addr = icr[i].Address; 1112 DO_ALIAS(&ip->ip_src);1113 1090 ip->ip_p = IPPROTO_ICMP; 1114 1091 ip->ip_dst.s_addr = so->so_laddr.s_addr; /*XXX: still the hack*/ -
trunk/src/VBox/Devices/Network/slirp/socket.h
r20306 r20959 79 79 int so_close; 80 80 #endif /* RT_OS_WINDOWS */ 81 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 81 82 82 void (* so_timeout)(PNATState pData, struct socket *so, void *arg); 83 83 void *so_timeout_arg; 84 #endif 84 85 85 #ifdef VBOX_WITH_NAT_SERVICE 86 86 /* storage of source ether address */ -
trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
r20650 r20959 404 404 { 405 405 case CTL_DNS: 406 #ifndef VBOX_WITH_MULTI_DNS407 if (!get_dns_addr(pData, &dns_addr))408 addr.sin_addr = dns_addr;409 else410 addr.sin_addr = loopback_addr;411 break;412 #endif413 406 case CTL_ALIAS: 414 407 default: -
trunk/src/VBox/Devices/Network/slirp/udp.c
r20245 r20959 231 231 so->so_fport = uh->uh_dport; /* XXX */ 232 232 233 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 233 /* 234 * DNS proxy 235 */ 234 236 if ( (ip->ip_dst.s_addr == htonl(ntohl(special_addr.s_addr) | CTL_DNS)) 235 237 && (ntohs(uh->uh_dport) == 53)) … … 238 240 goto bad; /* it isn't bad, probably better to add additional label done for boot/tftf :) */ 239 241 } 240 #endif241 242 242 243 iphlen += sizeof(struct udphdr);
Note:
See TracChangeset
for help on using the changeset viewer.