Changeset 79509 in vbox for trunk/src/VBox
- Timestamp:
- Jul 3, 2019 3:41:17 PM (6 years ago)
- Location:
- trunk/src/VBox/NetworkServices/Dhcpd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/Dhcpd/Config.cpp
r76553 r79509 74 74 int Config::homeInit() 75 75 { 76 int rc;77 78 76 /* pathname of ~/.VirtualBox or equivalent */ 79 77 char szHome[RTPATH_MAX]; 80 rc = com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome), false);78 int rc = com::GetVBoxUserHomeDirectory(szHome, sizeof(szHome), false); 81 79 if (RT_FAILURE(rc)) 82 80 { … … 596 594 parseServer(root); 597 595 598 /** @todo r=bird: Visual C++ 2010 does not grok this use of 'auto'. */599 596 // XXX: debug 600 597 for (optmap_t::const_iterator it = m_GlobalOptions.begin(); it != m_GlobalOptions.end(); ++it) { … … 721 718 722 719 723 /* 720 /** 724 721 * VM Config entries are generated automatically from VirtualBox.xml 725 722 * with the MAC fetched from the VM config. The client id is nowhere … … 787 784 788 785 789 /* 786 /** 790 787 * Parse <Option/> element and add the option to the specified optmap. 791 788 */ … … 845 842 846 843 847 /* 844 /** 848 845 * Set m_strBaseName to sanitized version of m_strNetwork that can be 849 846 * used in a path component. … … 861 858 return; 862 859 863 for (char *p = szBaseName; *p != '\0'; ++p) 864 { 865 if (RTPATH_IS_SEP(*p)) 866 { 860 char ch; 861 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 862 static const char s_szIllegals[] = "/\\\"*:<>?|\t\v\n\r\f\a\b"; /** @todo all control chars... */ 863 for (char *p = szBaseName; (ch = *p) != '\0'; ++p) 864 if (strchr(s_szIllegals, ch)) 867 865 *p = '_'; 868 } 869 } 866 #else 867 for (char *p = szBaseName; (ch = *p) != '\0'; ++p) 868 if (RTPATH_IS_SEP(ch)) 869 *p = '_'; 870 #endif 870 871 871 872 m_strBaseName.assign(szBaseName); -
trunk/src/VBox/NetworkServices/Dhcpd/Db.cpp
r76553 r79509 473 473 return addrBinding; 474 474 } 475 else 476 { 477 LogDHCP(("> .... cannot reuse %s binding for this address\n", 478 addrBinding->stateName())); 479 } 475 LogDHCP(("> .... cannot reuse %s binding for this address\n", 476 addrBinding->stateName())); 480 477 } 481 478 … … 544 541 Assert(b->id() == id); 545 542 546 /* 543 /** @todo 547 544 * XXX: handle requests for specific lease time! 548 545 * XXX: old lease might not have expired yet? -
trunk/src/VBox/NetworkServices/Dhcpd/Makefile.kmk
r76553 r79509 50 50 VBoxNetDhcpd_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS)) 51 51 52 VBoxNetDhcpd_DEFS = KBUILD_TYPE=\"$(KBUILD_TYPE)\"52 VBoxNetDhcpd_DEFS = KBUILD_TYPE=\"$(KBUILD_TYPE)\" 53 53 ifneq ($(KBUILD_TARGET),win) 54 54 VBoxNetDhcpd_DEFS += VBOX_WITH_XPCOM … … 59 59 endif 60 60 endif 61 VBoxNetDhcpd_SOURCES = ../../Main/glue/VBoxLogRelCreate.cpp \ 62 ../../Main/glue/GetVBoxUserHomeDirectory.cpp \ 63 ClientId.cpp \ 64 Config.cpp \ 65 DHCPD.cpp \ 66 Db.cpp \ 67 DhcpMessage.cpp \ 68 DhcpOptions.cpp \ 69 IPv4Pool.cpp \ 70 TimeStamp.cpp \ 71 VBoxNetDhcpd.cpp \ 72 $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES)) 61 VBoxNetDhcpd_SOURCES = \ 62 ClientId.cpp \ 63 Config.cpp \ 64 DHCPD.cpp \ 65 Db.cpp \ 66 DhcpMessage.cpp \ 67 DhcpOptions.cpp \ 68 IPv4Pool.cpp \ 69 TimeStamp.cpp \ 70 VBoxNetDhcpd.cpp \ 71 ../../Main/glue/VBoxLogRelCreate.cpp \ 72 ../../Main/glue/GetVBoxUserHomeDirectory.cpp \ 73 $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES)) 73 74 74 75 VBoxNetDhcpd_LIBS = $(LIB_RUNTIME) 75 76 76 VBoxNetDhcpd_LIBS.solaris += socket nsl 77 77 VBoxNetDhcpd_LDFLAGS.win = /SUBSYSTEM:windows -
trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp
r76553 r79509 244 244 int VBoxNetDhcpd::vmmInit() 245 245 { 246 int rc; 247 try { 248 std::vector<char> vExecDir(RTPATH_MAX); 249 rc = RTPathExecDir(&vExecDir.front(), vExecDir.size()); 250 if (RT_FAILURE(rc)) 251 return rc; 252 std::string strPath(&vExecDir.front()); 253 strPath.append("/VMMR0.r0"); 254 255 rc = SUPR3LoadVMM(strPath.c_str()); 256 if (RT_FAILURE(rc)) 257 return rc; 258 259 rc = VINF_SUCCESS; 260 } 261 catch (...) 262 { 263 rc = VERR_GENERAL_FAILURE; 264 } 265 246 char szPathVMMR0[RTPATH_MAX]; 247 int rc = RTPathExecDir(szPathVMMR0, sizeof(szPathVMMR0)); 248 if (RT_SUCCESS(rc)) 249 rc = RTPathAppend(szPathVMMR0, sizeof(szPathVMMR0), "VMMR0.r0"); 250 if (RT_SUCCESS(rc)) 251 rc = SUPR3LoadVMM(szPathVMMR0); 266 252 return rc; 267 253 } … … 316 302 317 303 OpenReq.fFlags = 0; 318 OpenReq.cbSend = 128 * _1K;319 OpenReq.cbRecv = 256 * _1K;304 OpenReq.cbSend = _128K; 305 OpenReq.cbRecv = _256K; 320 306 321 307 OpenReq.hIf = INTNET_HANDLE_INVALID; … … 471 457 472 458 473 /* 459 /** 474 460 * Got a frame from the internal network, feed it to the lwIP stack. 475 461 */ … … 495 481 */ 496 482 struct pbuf *q = p; 497 uint8_t *p u8Chunk = (uint8_t *)pvFrame;483 uint8_t *pbChunk = (uint8_t *)pvFrame; 498 484 do { 499 485 uint8_t *payload = (uint8_t *)q->payload; … … 507 493 } 508 494 #endif 509 memcpy(payload, p u8Chunk, len);510 p u8Chunk += len;495 memcpy(payload, pbChunk, len); 496 pbChunk += len; 511 497 q = q->next; 512 498 } while (RT_UNLIKELY(q != NULL)); … … 517 503 518 504 519 /* 505 /** 520 506 * Got a frame from the lwIP stack, feed it to the internal network. 521 507 */
Note:
See TracChangeset
for help on using the changeset viewer.