- Timestamp:
- Dec 2, 2011 2:58:07 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r39483 r39505 401 401 req_ip = dhcp_find_option(&bp->bp_vend[0], RFC2132_REQ_ADDR); 402 402 server_ip = dhcp_find_option(&bp->bp_vend[0], RFC2132_SRV_ID); 403 403 404 bc = find_addr(pData, &daddr, bp->bp_hwaddr); 404 405 … … 412 413 } 413 414 415 if ( !req_ip 416 || bp->bp_ciaddr.s_addr != INADDR_ANY) 417 { 418 LogRel(("NAT: Invalid SELECTING request\n")); 419 return -1; /* silently ignored */ 420 } 414 421 dhcp_stat = SELECTING; 415 422 Assert((bp->bp_ciaddr.s_addr == INADDR_ANY)); 416 Assert((*(uint32_t *)(req_ip + 2) == bc->addr.s_addr)); /*the same address as in offer*/417 423 #if 0 418 424 /* DSL xid in request differ from offer */ … … 441 447 { 442 448 case RENEWING: 449 /** 450 * decoding client messages RFC2131 (4.3.6) 451 * ------------------------------ 452 * | |RENEWING | 453 * ------------------------------ 454 * |broad/unicast |unicast | 455 * |server-ip |MUST NOT | 456 * |requested-ip |MUST NOT | 457 * |ciaddr |IP address | 458 * ------------------------------ 459 */ 443 460 Assert((server_ip == NULL && req_ip == NULL && bp->bp_ciaddr.s_addr != INADDR_ANY)); 461 if ( server_ip 462 || req_ip 463 || bp->bp_ciaddr.s_addr == INADDR_ANY) 464 { 465 LogRel(("NAT: invalid RENEWING dhcp request\n")); 466 return -1; /* silent ignorance */ 467 } 444 468 if (bc != NULL) 445 469 { … … 470 494 471 495 case INIT_REBOOT: 496 /** 497 * decoding client messages RFC2131 (4.3.6) 498 * ------------------------------ 499 * | |INIT-REBOOT | 500 * ------------------------------ 501 * |broad/unicast |broadcast | 502 * |server-ip |MUST NOT | 503 * |requested-ip |MUST | 504 * |ciaddr |zero | 505 * ------------------------------ 506 * 507 */ 472 508 Assert(server_ip == NULL); 473 509 Assert(req_ip != NULL); 510 if ( server_ip 511 || !req_ip 512 || bp->bp_ciaddr.s_addr != INADDR_ANY) 513 { 514 LogRel(("NAT: Invalid INIT-REBOOT dhcp request\n")); 515 return -1; /* silently ignored */ 516 } 474 517 ui32 = *(uint32_t *)(req_ip + 2); 475 518 if ((ui32 & RT_H2N_U32(pData->netmask)) != pData->special_addr.s_addr) … … 493 536 case NONE: 494 537 Assert((dhcp_stat != NONE)); 538 if (dhcp_stat == REBINDING) 539 LogRel(("NAT: REBINDING state isn't impemented\n")); 540 else if (dhcp_stat == SELECTING) 541 LogRel(("NAT: SELECTING state isn't impemented\n")); 495 542 return -1; 496 543 … … 709 756 bc = bc_alloc_client(pData); 710 757 Assert(bc); 758 if (!bc) 759 { 760 LogRel(("NAT: can't allocate bootp client object\n")); 761 break; 762 } 711 763 bc->addr.s_addr = req_ip.s_addr; 712 764 slirp_arp_who_has(pData, bc->addr.s_addr);
Note:
See TracChangeset
for help on using the changeset viewer.