diff --git a/configure.ac b/configure.ac index 0c7653675b..1c7c0d81c3 100644 --- a/configure.ac +++ b/configure.ac @@ -1463,6 +1463,18 @@ dnl includes too ${LOG4CPLUS_LIBS} SQLite: $SQLITE_CFLAGS $SQLITE_LIBS +END + +# Avoid confusion on DNS/DHCP and only mention MySQL if it +# were specified on the command line. +if test "$MYSQL_CPPFLAGS" != "" ; then +cat >> config.report << END + MySQL: $MYSQL_CPPFLAGS + $MYSQL_LIBS +END +fi + +cat >> config.report << END Features: $enable_features diff --git a/src/lib/dhcp/lease_mgr.cc b/src/lib/dhcp/lease_mgr.cc index c86bca3315..809c528ef3 100644 --- a/src/lib/dhcp/lease_mgr.cc +++ b/src/lib/dhcp/lease_mgr.cc @@ -12,18 +12,6 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include #include using namespace std; diff --git a/src/lib/dhcp/lease_mgr.h b/src/lib/dhcp/lease_mgr.h index fbb1584eb4..0f54634835 100644 --- a/src/lib/dhcp/lease_mgr.h +++ b/src/lib/dhcp/lease_mgr.h @@ -12,8 +12,8 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#ifndef __LEASE_MGR_H -#define __LEASE_MGR_H +#ifndef LEASE_MGR_H +#define LEASE_MGR_H #include #include @@ -556,4 +556,4 @@ protected: }; // end of isc::dhcp namespace }; // end of isc namespace -#endif // __LEASE_MGR_H +#endif // LEASE_MGR_H diff --git a/src/lib/dhcp/lease_mgr_factory.h b/src/lib/dhcp/lease_mgr_factory.h index abd1bba60d..e9d73bab6c 100644 --- a/src/lib/dhcp/lease_mgr_factory.h +++ b/src/lib/dhcp/lease_mgr_factory.h @@ -12,8 +12,8 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#ifndef __LEASE_MGR_FACTORY_H -#define __LEASE_MGR_FACTORY_H +#ifndef LEASE_MGR_FACTORY_H +#define LEASE_MGR_FACTORY_H #include #include @@ -120,4 +120,4 @@ private: }; // end of isc::dhcp namespace }; // end of isc namespace -#endif // __LEASE_MGR_FACTORY_H +#endif // LEASE_MGR_FACTORY_H diff --git a/src/lib/dhcp/mysql_lease_mgr.cc b/src/lib/dhcp/mysql_lease_mgr.cc index 6627dfb235..d71de26708 100644 --- a/src/lib/dhcp/mysql_lease_mgr.cc +++ b/src/lib/dhcp/mysql_lease_mgr.cc @@ -375,6 +375,7 @@ MySqlLeaseMgr::convertToDatabaseTime(time_t cltt, uint32_t valid_lifetime, MYSQL_TIME& expire) { // Calculate expiry time and convert to various date/time fields. + // @TODO: handle overflows time_t expire_time = cltt + valid_lifetime; // Convert to broken-out time diff --git a/src/lib/dhcp/mysql_lease_mgr.h b/src/lib/dhcp/mysql_lease_mgr.h index 9e28390caa..e7dc4b2217 100644 --- a/src/lib/dhcp/mysql_lease_mgr.h +++ b/src/lib/dhcp/mysql_lease_mgr.h @@ -12,8 +12,8 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#ifndef __MYSQL_LEASE_MGR_H -#define __MYSQL_LEASE_MGR_H +#ifndef MYSQL_LEASE_MGR_H +#define MYSQL_LEASE_MGR_H #include #include @@ -402,4 +402,4 @@ private: }; // end of isc::dhcp namespace }; // end of isc namespace -#endif // __MYSQL_LEASE_MGR_H +#endif // MYSQL_LEASE_MGR_H diff --git a/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc b/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc index b267bc3dd9..08179d77b2 100644 --- a/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc +++ b/src/lib/dhcp/tests/mysql_lease_mgr_unittest.cc @@ -331,8 +331,13 @@ TEST_F(MySqlLeaseMgrTest, BasicLease6) { duid.push_back(i + 5); } l3->duid_ = boost::shared_ptr(new DUID(duid)); - l3->preferred_lft_ = 0xfffffffc; // Preferred lifetime - l3->valid_lft_ = 0xfffffffd; // Actual lifetime + + // The times used in the next tests are deliberately restricted - we should + // be avle to cope with valid lifetimes up to 0xffffffff. However, this + // will lead to overflows. + // @TODO: test overflow conditions when code has been fixed + l3->preferred_lft_ = 7200; // Preferred lifetime + l3->valid_lft_ = 7000; // Actual lifetime l3->cltt_ = 234567; // Current time of day l3->subnet_id_ = l1->subnet_id_; // Same as l1