Fix a possible infinite loop in netconf service... in the long term need to fix IP assignment logic period cause the current incarnation sucks.

This commit is contained in:
Adam Ierymenko 2014-02-06 10:59:50 -08:00
parent d0e5da2884
commit 6d17993eb6

View file

@ -277,7 +277,7 @@ int main(int argc,char **argv)
std::string desc;
{
Query q = dbCon->query();
q << "SELECT name,`desc`,isOpen,multicastPrefixBits,multicastDepth,emulateArp,emulateNdp,arpCacheTtl,ndpCacheTtl FROM Network WHERE id = " << nwid;
q << "SELECT * FROM Network WHERE id = " << nwid;
StoreQueryResult rs = q.store();
if (rs.num_rows() > 0) {
name = rs[0]["name"].c_str();
@ -411,6 +411,7 @@ int main(int argc,char **argv)
uint32_t ipNet = (uint32_t)((unsigned long)rs[aaRow]["ipNet"]);
unsigned int netmaskBits = (unsigned int)rs[aaRow]["netmaskBits"];
if ((netmaskBits > 0)&&(ipNet)) {
uint32_t tryIp = (((uint32_t)addressBytes[1]) << 24) |
(((uint32_t)addressBytes[2]) << 16) |
(((uint32_t)addressBytes[3]) << 8) |
@ -445,6 +446,7 @@ int main(int argc,char **argv)
}
}
}
}
// Assemble response dictionary to send to peer
Dictionary netconf;