Allow boolean options of true and True as well as 0 and 1.

git-svn-id: file:///home/svn/framework3/trunk@13796 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Weeks 2011-09-26 19:16:02 +00:00
parent b3e96add60
commit a82adb14f9
3 changed files with 3 additions and 3 deletions

View File

@ -204,13 +204,13 @@ int DHCPserv::run(){
bool serveOnce = true;
string soncestr("SERVEONCE");
if(options.count(soncestr) > 0)
serveOnce = atoi(options[soncestr].c_str()) != 0;
serveOnce = atoi(options[soncestr].c_str()) != 0 || (options[soncestr].at(0) | 0x20) == 't';
//get PXE
bool servePXE = true;
string pxestring("PXE");
if(options.count(pxestring) > 0)
servePXE = atoi(options[pxestring].c_str()) != 0;
servePXE = atoi(options[pxestring].c_str()) != 0 || (options[pxestring].at(0) | 0x20) == 't';
//get HOSTNAME
string hostname; //hostname to give out
@ -368,7 +368,7 @@ int DHCPserv::run(){
pkt << dhcpoption(OpPXEMagic, pxemagic);
// check if already served based on hw addr (MAC address)
if (serveOnce == true && served.count(clienthwaddr) > 0 || served.size() > 0){
if (serveOnce == true && served.count(clienthwaddr) > 0){
pkt << dhcpoption(OpPXEConfigFile, pxeAltConfigFile); //Already served; allowing normal boot
}else{
pkt << dhcpoption(OpPXEConfigFile, pxeConfigFile);