Changeset 19748 in vbox
- Timestamp:
- May 15, 2009 4:07:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r19313 r19748 157 157 (q) = (uint8_t *)(&be[1]) + (len); \ 158 158 }while(0) 159 /* appending another value to tag, calculates len of whole block*/ 160 #define FILL_BOOTP_APP(head, q, tag, len, pvalue) \ 161 do { \ 162 struct bootp_ext *be = (struct bootp_ext *)(head); \ 163 memcpy(q, (pvalue), (len)); \ 164 (q) += (len); \ 165 Assert(be->bpe_tag == (tag)); \ 166 be->bpe_len += (len); \ 167 }while(0) 159 168 160 169 /* extract exact DHCP msg type */ … … 297 306 struct dns_domain_entry *dd = NULL; 298 307 int added = 0; 308 uint8_t *q_dns_header = NULL; 299 309 #endif 300 310 uint32_t lease_time = htonl(LEASE_TIME); … … 313 323 uint32_t addr = htonl(ntohl(special_addr.s_addr) | CTL_DNS); 314 324 FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &addr); 315 }316 else325 goto skip_dns_servers; 326 } 317 327 # endif 328 329 330 if (!LIST_EMPTY(&pData->dns_list_head)) 331 { 332 de = LIST_FIRST(&pData->dns_list_head); 333 q_dns_header = q; 334 FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr); 335 } 336 318 337 LIST_FOREACH(de, &pData->dns_list_head, de_list) 319 338 { 320 FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr); 321 } 339 if (LIST_FIRST(&pData->dns_list_head) == de) 340 continue; /* first value with head we've ingected before */ 341 FILL_BOOTP_APP(q_dns_header, q, RFC1533_DNS, 4, &de->de_addr.s_addr); 342 } 343 344 #ifdef VBOX_WITH_SLIRP_DNS_PROXY 345 skip_dns_servers: 346 #endif 322 347 if (LIST_EMPTY(&pData->dns_domain_list_head)) 323 348 {
Note:
See TracChangeset
for help on using the changeset viewer.