Changeset 48956 in vbox for trunk/src/VBox/NetworkServices/DHCP
- Timestamp:
- Oct 7, 2013 10:00:27 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 89653
- Location:
- trunk/src/VBox/NetworkServices/DHCP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/Config.cpp
r48877 r48956 124 124 bool fDhcpValid = false; 125 125 uint8_t uMsgType = 0; 126 126 127 127 fDhcpValid = RTNetIPv4IsDHCPValid(NULL, pDhcpMsg, cbDhcpMsg, &uMsgType); 128 128 AssertReturn(fDhcpValid, NULL); … … 230 230 */ 231 231 AssertPtrReturn(client, NULL); 232 232 233 233 /** 234 234 * This mean that client has already bound or commited lease. 235 * If we've it happens it means that we received DHCPDISCOVER twice. 235 * If we've it happens it means that we received DHCPDISCOVER twice. 236 236 */ 237 237 if (client->m_lease) … … 265 265 } 266 266 267 if ( hintAddress.u 267 if ( hintAddress.u 268 268 && !isAddressTaken(hintAddress, NULL)) 269 269 { … … 295 295 } 296 296 } 297 297 298 298 return NULL; 299 299 } … … 318 318 delete client->m_lease; 319 319 client->m_lease = NULL; 320 320 321 321 return VINF_SUCCESS; 322 322 } … … 325 325 { 326 326 MapLease2Ip4AddressIterator it; 327 327 328 328 for (it = m_allocations.begin(); 329 329 it != m_allocations.end(); … … 334 334 if (ppLease) 335 335 *ppLease = it->first; 336 336 337 337 return true; 338 338 } … … 477 477 * Network manager creates DHCPOFFER datagramm 478 478 */ 479 int NetworkManager::offer4Client(Client *client, uint32_t u32Xid, 479 int NetworkManager::offer4Client(Client *client, uint32_t u32Xid, 480 480 uint8_t *pu8ReqList, int cReqList) 481 481 { … … 485 485 prepareReplyPacket4Client(client, u32Xid); 486 486 487 487 488 488 RTNETADDRIPV4 address = client->m_lease->m_address; 489 489 BootPReplyMsg.BootPHeader.bp_yiaddr = address; … … 579 579 { 580 580 AssertPtrReturn(client, VERR_INTERNAL_ERROR); 581 582 if (!client->m_lease) 581 582 if (!client->m_lease) 583 583 return VERR_INTERNAL_ERROR; 584 584 … … 740 740 case RTNET_DHCP_OPT_DNS: 741 741 { 742 const Ipv4AddressContainer lst = 742 const Ipv4AddressContainer lst = 743 743 g_ConfigurationManager->getAddressList(pReqList[idxParam]); 744 744 PRTNETADDRIPV4 pAddresses = (PRTNETADDRIPV4)&opt.au8RawOpt[0]; -
trunk/src/VBox/NetworkServices/DHCP/Config.h
r48483 r48956 366 366 367 367 /** 368 * 368 * 369 369 */ 370 370 Client* getClientByDhcpPacket(const RTNETBOOTP *pDhcpMsg, size_t cbDhcpMsg); … … 382 382 */ 383 383 int commitLease4Client(Client *client); 384 384 385 385 /** 386 386 * Expires client lease. … … 487 487 } 488 488 virtual ~Lease(){} 489 489 490 490 bool isExpired() 491 491 { 492 492 if (!fBinding) 493 return (ASMDivU64ByU32RetU32(RTTimeMilliTS() - u64TimestampLeasingStarted, 1000) 493 return (ASMDivU64ByU32RetU32(RTTimeMilliTS() - u64TimestampLeasingStarted, 1000) 494 494 > u32LeaseExpirationPeriod); 495 495 else 496 return (ASMDivU64ByU32RetU32(RTTimeMilliTS() - u64TimestampBindingStarted, 1000) 496 return (ASMDivU64ByU32RetU32(RTTimeMilliTS() - u64TimestampBindingStarted, 1000) 497 497 > u32BindExpirationPeriod); 498 498 … … 501 501 /* XXX private: */ 502 502 RTNETADDRIPV4 m_address; 503 503 504 504 /** lease isn't commited */ 505 505 bool fBinding; 506 506 507 507 /** Timestamp when lease commited. */ 508 508 uint64_t u64TimestampLeasingStarted; -
trunk/src/VBox/NetworkServices/DHCP/Makefile.kmk
r47025 r48956 57 57 58 58 # 59 # VBOXMAINCLIENT here only to use DhcpOpt_T type. 59 # VBOXMAINCLIENT here only to use DhcpOpt_T type. 60 60 tstDhcpConfig_TEMPLATE = VBOXMAINCLIENTEXE 61 61 #XXX: enable condtionally if user is vvl -
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r48461 r48956 467 467 if (SUCCEEDED(host->COMGETTER(DomainName)(domain.asOutParam()))) 468 468 confManager->setString(RTNET_DHCP_OPT_DOMAIN_NAME, std::string(com::Utf8Str(domain).c_str())); 469 469 470 470 471 471 }
Note:
See TracChangeset
for help on using the changeset viewer.