- Timestamp:
- Dec 5, 2014 9:12:22 AM (10 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c
r50673 r53448 121 121 AssertPtrReturnVoid(arg); 122 122 123 if ( req->dns_server == NULL 123 if ( req->dnsgen != pData->dnsgen 124 || req->dns_server == NULL 124 125 || (de = TAILQ_PREV(req->dns_server, dns_list_head, de_list)) == NULL) 125 126 { 127 if (req->dnsgen != pData->dnsgen) 128 { 129 /* XXX: Log2 */ 130 LogRel(("NAT: dnsproxy: timeout: req %p dnsgen %u != %u on %R[natsock]\n", 131 req, req->dnsgen, pData->dnsgen, so)); 132 } 126 133 hash_remove_request(pData, req); 127 134 RTMemFree(req); … … 356 363 memcpy(&req->clientid, &buf[0], 2); 357 364 req->dns_server = TAILQ_LAST(&pData->pDnsList, dns_list_head); 365 req->dnsgen = pData->dnsgen; 358 366 if (req->dns_server == NULL) 359 367 { … … 375 383 else 376 384 { 377 retransmit = 1; 385 if (req->dnsgen != pData->dnsgen) 386 { 387 /* XXX: Log2 */ 388 LogRel(("NAT: dnsproxy: query: req %p dnsgen %u != %u on %R[natsock]\n", 389 req, req->dnsgen, pData->dnsgen, so)); 390 /* 391 * XXX: TODO: this probably requires more cleanup. 392 * Cf. XXX comment for sendto() failure below, but that 393 * error leg is probably untested since ~never taken. 394 */ 395 ++dropped_queries; 396 return; 397 } 398 retransmit = 1; 378 399 } 379 400 … … 404 425 405 426 /* send it to our authoritative server */ 406 Log2(("NAT: request will be sent to %RTnaipv4 on %R[natsock]\n", addr.sin_addr, so)); 427 Log2(("NAT: request will be %ssent to %RTnaipv4 on %R[natsock]\n", 428 retransmit ? "re" : "", addr.sin_addr, so)); 407 429 408 430 byte = sendto(so->s, buf, (unsigned int)byte, 0, … … 418 440 419 441 so->so_state = SS_ISFCONNECTED; /* now it's selected */ 420 Log2(("NAT: request was sent to %RTnaipv4 on %R[natsock]\n", addr.sin_addr, so)); 442 Log2(("NAT: request was %ssent to %RTnaipv4 on %R[natsock]\n", 443 retransmit ? "re" : "", addr.sin_addr, so)); 421 444 422 445 ++authoritative_queries; -
trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.h
r26495 r53448 82 82 * it's value on next server. And dnsproxy_query should 83 83 * initializate with first server in the list 84 * 85 * dnsgen is a generation number - a copy of pData->dnsgen at the 86 * time of request creation (poor man's weak reference). 87 * dns_server must not be used if pData->dnsgen changed. 84 88 */ 85 89 struct dns_entry *dns_server; 90 uint32_t dnsgen; 86 91 int nbyte; /* length of dns request */ 87 92 char byte[1]; /* copy of original request */ -
trunk/src/VBox/Devices/Network/slirp/slirp_dns.c
r51642 r53448 304 304 RTMemFree(pDomain); 305 305 } 306 307 /* tell any pending dnsproxy requests their copy is expired */ 308 ++pData->dnsgen; 309 306 310 LogFlowFuncLeaveRC(rc); 307 311 return rc; -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r53399 r53448 151 151 struct dns_list_head pDnsList; 152 152 struct dns_domain_list_head pDomainList; 153 uint32_t dnsgen; /* XXX: merge with dnsLastUpdate? */ 153 154 struct in_addr tftp_server; 154 155 struct in_addr loopback_addr;
Note:
See TracChangeset
for help on using the changeset viewer.