Changeset 79866 in vbox
- Timestamp:
- Jul 18, 2019 8:32:47 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132264
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/DHCPConfigImpl.cpp
r79846 r79866 84 84 char *pszNext; 85 85 int vrc = RTStrToUInt8Ex(psz, &pszNext, 10, &bOpt); 86 if (vrc == VINF_SUCCESS || vrc == VWRN_TRAILING_SPACES) 86 if ( vrc == VINF_SUCCESS 87 || vrc == VWRN_TRAILING_SPACES 88 || vrc == VWRN_TRAILING_CHARS) 87 89 { 88 90 try … … 525 527 pElmConfig->setAttribute("secMaxLeaseTime", (uint32_t)m_secMaxLeaseTime); 526 528 529 struct 530 { 531 const char *pszElement; 532 std::vector<DHCPOption_T> *pVec; 533 } aVec2Elm[] = { { "ForcedOption", &m_vecForcedOptions }, { "SuppressedOption", &m_vecSuppressedOptions }, }; 534 for (size_t i = 0; i < RT_ELEMENTS(aVec2Elm); i++) 535 for (std::vector<DHCPOption_T>::const_iterator it = aVec2Elm[i].pVec->begin(); it != aVec2Elm[i].pVec->end(); ++it) 536 { 537 xml::ElementNode *pElmChild = pElmConfig->createChild(aVec2Elm[i].pszElement); 538 pElmChild->setAttribute("name", (int)*it); 539 } 540 527 541 for (settings::DhcpOptionMap::const_iterator it = m_OptionMap.begin(); it != m_OptionMap.end(); ++it) 528 542 { 529 xml::ElementNode *p Option = pElmConfig->createChild("Option");530 p Option->setAttribute("name", (int)it->first);531 p Option->setAttribute("encoding", it->second.enmEncoding);532 p Option->setAttribute("value", it->second.strValue);543 xml::ElementNode *pElmOption = pElmConfig->createChild("Option"); 544 pElmOption->setAttribute("name", (int)it->first); 545 pElmOption->setAttribute("encoding", it->second.enmEncoding); 546 pElmOption->setAttribute("value", it->second.strValue); 533 547 } 534 548 } -
trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp
r79845 r79866 257 257 ComObjPtr<DHCPIndividualConfig> ptrIndiCfg; 258 258 com::Utf8Str strKey; 259 if ( !it->second.strVMName.isNotEmpty())259 if (it->second.strVMName.isEmpty()) 260 260 { 261 261 RTMAC MACAddress; … … 282 282 if (SUCCEEDED(hrc)) 283 283 { 284 int vrc = strKey.printfNoThrow("%RTuuid/%u", idMachine.raw(), it->second.uSlot); 285 AssertRCReturn(vrc, E_OUTOFMEMORY); 286 284 287 hrc = ptrIndiCfg.createObject(); 285 288 if (SUCCEEDED(hrc)) … … 851 854 { 852 855 m->individualConfigs[strKey] = a_rPtrConfig; 853 return S_OK; 856 857 /* Save settings. */ 858 alock.release(); 859 return i_doSaveSettings(); 854 860 } 855 861 catch (std::bad_alloc &) … … 1151 1157 vrc = m->dhcp.addArgPair("--config", m->strConfigFilename.c_str()); 1152 1158 if (RT_SUCCESS(vrc)) 1153 vrc = m->dhcp.addArgPair("--log", m-> networkName.c_str());1159 vrc = m->dhcp.addArgPair("--log", m->strLogFilename.c_str()); 1154 1160 /** @todo Add --log-flags, --log-group-settings, and --log-destinations with 1155 1161 * associated IDHCPServer attributes. (Not doing it now because that'll
Note:
See TracChangeset
for help on using the changeset viewer.