Changeset 19979 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- May 25, 2009 2:29:12 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r19851 r19979 331 331 332 332 333 if (! LIST_EMPTY(&pData->dns_list_head))334 { 335 de = LIST_FIRST(&pData->dns_list_head);333 if (!TAILQ_EMPTY(&pData->dns_list_head)) 334 { 335 de = TAILQ_LAST(&pData->dns_list_head, dns_list_head); 336 336 q_dns_header = q; 337 337 FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr); 338 338 } 339 339 340 LIST_FOREACH(de, &pData->dns_list_head, de_list)341 { 342 if ( LIST_FIRST(&pData->dns_list_head) == de)340 TAILQ_FOREACH_REVERSE(de, &pData->dns_list_head, dns_list_head, de_list) 341 { 342 if (TAILQ_LAST(&pData->dns_list_head, dns_list_head) == de) 343 343 continue; /* first value with head we've ingected before */ 344 344 FILL_BOOTP_APP(q_dns_header, q, RFC1533_DNS, 4, &de->de_addr.s_addr); -
trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c
r19700 r19979 106 106 struct request *req = (struct request *)arg; 107 107 struct dns_entry *de; 108 de = LIST_NEXT(req->dns_server, de_list);108 de = TAILQ_PREV(req->dns_server, dns_list_head, de_list); 109 109 /* here we should check if we reached the end of the DNS server list */ 110 110 if (de == NULL) … … 269 269 memcpy(&req->client, &fromaddr, sizeof(struct sockaddr_in)); 270 270 memcpy(&req->clientid, &buf[0], 2); 271 req->dns_server = LIST_FIRST(&pData->dns_list_head);271 req->dns_server = TAILQ_LAST(&pData->dns_list_head, dns_list_head); 272 272 if (req->dns_server == NULL) 273 273 { -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r19977 r19979 377 377 da->de_addr.s_addr = ((struct sockaddr_in *)saddr)->sin_addr.s_addr; 378 378 } 379 LIST_INSERT_HEAD(&pData->dns_list_head, da, de_list);379 TAILQ_INSERT_HEAD(&pData->dns_list_head, da, de_list); 380 380 381 381 if (addr->DnsSuffix == NULL) … … 583 583 static int slirp_init_dns_list(PNATState pData) 584 584 { 585 LIST_INIT(&pData->dns_list_head);585 TAILQ_INIT(&pData->dns_list_head); 586 586 LIST_INIT(&pData->dns_domain_list_head); 587 587 return get_dns_addr_domain(pData, true, NULL, NULL); … … 592 592 struct dns_entry *de = NULL; 593 593 struct dns_domain_entry *dd = NULL; 594 while(!LIST_EMPTY(&pData->dns_domain_list_head)) { 595 dd = LIST_FIRST(&pData->dns_domain_list_head); 596 LIST_REMOVE(dd, dd_list); 597 if (dd->dd_pszDomain != NULL) 598 RTStrFree(dd->dd_pszDomain); 599 RTMemFree(dd); 594 while(!TAILQ_EMPTY(&pData->dns_list_head)) { 595 de = TAILQ_FIRST(&pData->dns_list_head); 596 TAILQ_REMOVE(&pData->dns_list_head, de, de_list); 597 RTMemFree(de); 600 598 } 601 599 while(!LIST_EMPTY(&pData->dns_domain_list_head)) { -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r19977 r19979 70 70 { 71 71 struct in_addr de_addr; 72 LIST_ENTRY(dns_entry) de_list;72 TAILQ_ENTRY(dns_entry) de_list; 73 73 }; 74 LIST_HEAD(dns_list_head, dns_entry);74 TAILQ_HEAD(dns_list_head, dns_entry); 75 75 #endif 76 76
Note:
See TracChangeset
for help on using the changeset viewer.