Changeset 29656 in vbox for trunk/src/VBox/Devices
- Timestamp:
- May 19, 2010 6:05:09 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r29506 r29656 636 636 struct in_addr req_ip; 637 637 int fDhcpDiscover = 0; 638 uint8_t *parameter_list = NULL; 638 639 struct mbuf *m = NULL; 639 640 … … 651 652 if (p == NULL) 652 653 return; 654 /* 655 * We're going update dns list at least once per DHCP transaction (!not on every operation 656 * within transaction), assuming that transaction can't be longer than 1 min. 657 */ 658 if ( !pData->fUseHostResolver 659 && ( pData->dnsLastUpdate == 0 660 || curtime - pData->dnsLastUpdate > 60 * 1000)) /* one minute*/ 661 { 662 uint8_t i = 2; /* i = 0 - tag, i == 1 - length */ 663 parameter_list = dhcp_find_option(&bp->bp_vend[0], RFC2132_PARAM_LIST); 664 for (;parameter_list && i < parameter_list[1]; ++i) 665 { 666 if (parameter_list[i] == RFC1533_DNS) 667 { 668 slirp_release_dns_list(pData); 669 slirp_init_dns_list(pData); 670 pData->dnsLastUpdate = curtime; 671 break; 672 } 673 } 674 } 653 675 654 676 #ifndef VBOX_WITH_SLIRP_BSD_MBUF -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r29506 r29656 532 532 #endif /* !RT_OS_WINDOWS */ 533 533 534 staticint slirp_init_dns_list(PNATState pData)534 int slirp_init_dns_list(PNATState pData) 535 535 { 536 536 TAILQ_INIT(&pData->pDnsList); … … 539 539 } 540 540 541 staticvoid slirp_release_dns_list(PNATState pData)541 void slirp_release_dns_list(PNATState pData) 542 542 { 543 543 struct dns_entry *pDns = NULL; -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r29506 r29656 341 341 void slirp_arp_cache_add(PNATState pData, uint32_t ip, const uint8_t *ether); 342 342 int slirp_arp_cache_update_or_add(PNATState pData, uint32_t dst, const uint8_t *mac); 343 int slirp_init_dns_list(PNATState pData); 344 void slirp_release_dns_list(PNATState pData); 343 345 #define MIN_MRU 128 344 346 #define MAX_MRU 16384 -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r29506 r29656 175 175 struct in_addr tftp_server; 176 176 struct in_addr loopback_addr; 177 uint32_t dnsLastUpdate; 177 178 uint32_t netmask; 178 179 #ifndef VBOX_WITH_NAT_SERVICE
Note:
See TracChangeset
for help on using the changeset viewer.