Changeset 48947 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Oct 7, 2013 9:41:00 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 89644
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c
r48526 r48947 120 120 /* be paranoid */ 121 121 AssertPtrReturnVoid(arg); 122 122 123 123 de = TAILQ_PREV(req->dns_server, dns_list_head, de_list); 124 124 125 125 if (de == NULL) 126 126 { … … 137 137 struct mbuf *m = NULL; 138 138 char *data; 139 139 140 140 m = slirpDnsMbufAlloc(pData); 141 141 if (m == NULL) … … 168 168 169 169 /* expiration will be bumped in dnsproxy_query */ 170 170 171 171 dnsproxy_query(pData, so, m, iphlen); 172 172 /* should we free so->so_m ? */ 173 173 return; 174 174 } 175 176 socket_clean_up: 175 176 socket_clean_up: 177 177 /* This socket (so) will be detached, so we need to remove timeout(&_arg) references 178 * before leave 178 * before leave 179 179 */ 180 180 so->so_timeout = NULL; … … 309 309 #else /* VBOX */ 310 310 AssertPtr(pData); 311 311 312 312 /* m->m_data points to IP header */ 313 313 #if 0 … … 340 340 341 341 342 req = so->so_timeout_arg; 342 req = so->so_timeout_arg; 343 343 344 344 if (!req) … … 347 347 Assert(!so->so_timeout_arg); 348 348 349 if ((req = RTMemAllocZ(sizeof(struct request) + byte)) == NULL) 349 if ((req = RTMemAllocZ(sizeof(struct request) + byte)) == NULL) 350 350 { 351 351 LogRel(("calloc failed\n")); … … 382 382 383 383 req->recursion = 0; 384 384 385 385 DPRINTF(("External query RD=%d\n", RD(buf))); 386 386 387 387 if (retransmit == 0) 388 388 hash_add_request(pData, req); … … 394 394 /* let's slirp to care about expiration */ 395 395 so->so_expire = curtime + recursive_timeout * 1000; 396 396 397 397 memset(&addr, 0, sizeof(struct sockaddr_in)); 398 398 addr.sin_family = AF_INET; … … 408 408 /* send it to our authoritative server */ 409 409 Log2(("NAT: request will be sent to %RTnaipv4 on %R[natsock]\n", addr.sin_addr, so)); 410 410 411 411 byte = sendto(so->s, buf, (unsigned int)byte, 0, 412 412 (struct sockaddr *)&addr, 413 413 sizeof(struct sockaddr_in)); 414 if (byte == -1) 414 if (byte == -1) 415 415 { 416 416 /* XXX: is it really enough? */ … … 425 425 ++authoritative_queries; 426 426 427 # if 0 428 /* XXX: this stuff for _debugging_ only, 429 * first enforce guest to send next request 430 * and second for faster getting timeout callback 431 * other option is adding couple entries in resolv.conf with 427 # if 0 428 /* XXX: this stuff for _debugging_ only, 429 * first enforce guest to send next request 430 * and second for faster getting timeout callback 431 * other option is adding couple entries in resolv.conf with 432 432 * invalid nameservers. 433 433 * 434 * For testing purposes could be used 435 * namebench -S -q 10000 -m random or -m chunk 434 * For testing purposes could be used 435 * namebench -S -q 10000 -m random or -m chunk 436 436 */ 437 437 /* RTThreadSleep(3000); */ … … 497 497 LogRel(("sendto failed: %s\n", strerror(errno))); 498 498 ++dropped_answers; 499 } 499 } 500 500 else 501 501 ++answered_queries; … … 509 509 510 510 AssertPtr(pData); 511 511 512 512 /* XXX: mbuf->data points to ??? */ 513 513 byte = m->m_len; … … 524 524 525 525 /* find corresponding query */ 526 if (query == NULL) 526 if (query == NULL) 527 527 { 528 /* XXX: if we haven't found anything for this request ... 528 /* XXX: if we haven't found anything for this request ... 529 529 * What we are expecting later? 530 530 */ -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r48526 r48947 354 354 /* set default addresses */ 355 355 inet_aton("127.0.0.1", &loopback_addr); 356 356 357 357 if (!fUseHostResolver) 358 358 { … … 744 744 if (so->so_timeout != NULL) 745 745 { 746 /* so_timeout - might change the so_expire value or 747 * drop so_timeout* from so. 746 /* so_timeout - might change the so_expire value or 747 * drop so_timeout* from so. 748 748 */ 749 749 so->so_timeout(pData, so, so->so_timeout_arg); 750 /* on 4.2 so-> 750 /* on 4.2 so-> 751 751 */ 752 752 if ( so_next->so_prev != so /* so_timeout freed the socket */
Note:
See TracChangeset
for help on using the changeset viewer.