From: Tomek Mrugalski Date: Tue, 13 Dec 2011 13:53:59 +0000 (+0100) Subject: [1237] Compilation fixes in dhcp4 and dhcp6 components. X-Git-Tag: trac2351_base~299^2~6^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6bbffedb003004dbbbc1b05b7c909e5cf03c529c;p=thirdparty%2Fkea.git [1237] Compilation fixes in dhcp4 and dhcp6 components. --- diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 780f3dc827..0a1aabad90 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -33,7 +33,10 @@ Dhcpv4Srv::Dhcpv4Srv(uint16_t port) { /// @todo: instantiate LeaseMgr here once it is imlpemented. IfaceMgr::instance().printIfaces(); +#if 0 + // uncomment this once #1238, #992 and #1239 are merged IfaceMgr::instance().openSockets4(port); +#endif setServerID(); diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 31c6afb783..b126456264 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -43,7 +43,11 @@ Dhcpv6Srv::Dhcpv6Srv(uint16_t port) { } // Now try to open IPv6 sockets on detected interfaces. + cout << "Opening sockets on port " << port << endl; +#if 0 + // uncomment this once #1238, #992 and #1239 are merged IfaceMgr::instance().openSockets6(port); +#endif /// @todo: instantiate LeaseMgr here once it is imlpemented. diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index 72a4ed278b..c90d00daf4 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -17,8 +17,9 @@ #include #include -#include "dhcp/pkt6.h" -#include "dhcp/option.h" +#include +#include +#include #include namespace isc { diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc index 18d2cd68bd..651c07bdf4 100644 --- a/src/lib/dhcp/iface_mgr.cc +++ b/src/lib/dhcp/iface_mgr.cc @@ -159,7 +159,7 @@ void IfaceMgr::detectIfaces() { } #endif -bool IfaceMgr::openSockets6() { +bool IfaceMgr::openSockets6(uint16_t port) { int sock; for (IfaceLst::iterator iface=ifaces_.begin(); @@ -175,8 +175,7 @@ bool IfaceMgr::openSockets6() { continue; } - sock = openSocket(iface->name_, *addr, - DHCP6_SERVER_PORT); + sock = openSocket(iface->name_, *addr, port); if (sock<0) { cout << "Failed to open unicast socket." << endl; return (false); diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h index ea0f43ae2c..2155ae8249 100644 --- a/src/lib/dhcp/iface_mgr.h +++ b/src/lib/dhcp/iface_mgr.h @@ -237,8 +237,9 @@ protected: private: /// Opens sockets on detected interfaces. - bool - openSockets6(); + /// + /// @param port specifies port on which sockets will be open + bool openSockets6(uint16_t port); /// creates a single instance of this class (a singleton implementation) static void