Parcourir la source

[1237] Compilation fixes in dhcp4 and dhcp6 components.

Tomek Mrugalski il y a 13 ans
Parent
commit
6bbffedb00

+ 3 - 0
src/bin/dhcp4/dhcp4_srv.cc

@@ -33,7 +33,10 @@ Dhcpv4Srv::Dhcpv4Srv(uint16_t port) {
     /// @todo: instantiate LeaseMgr here once it is imlpemented.
     /// @todo: instantiate LeaseMgr here once it is imlpemented.
     IfaceMgr::instance().printIfaces();
     IfaceMgr::instance().printIfaces();
 
 
+#if 0
+    // uncomment this once #1238, #992 and #1239 are merged
     IfaceMgr::instance().openSockets4(port);
     IfaceMgr::instance().openSockets4(port);
+#endif
 
 
     setServerID();
     setServerID();
 
 

+ 4 - 0
src/bin/dhcp6/dhcp6_srv.cc

@@ -43,7 +43,11 @@ Dhcpv6Srv::Dhcpv6Srv(uint16_t port) {
     }
     }
 
 
     // Now try to open IPv6 sockets on detected interfaces.
     // 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);
     IfaceMgr::instance().openSockets6(port);
+#endif
 
 
     /// @todo: instantiate LeaseMgr here once it is imlpemented.
     /// @todo: instantiate LeaseMgr here once it is imlpemented.
 
 

+ 3 - 2
src/bin/dhcp6/dhcp6_srv.h

@@ -17,8 +17,9 @@
 
 
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/noncopyable.hpp>
-#include "dhcp/pkt6.h"
-#include "dhcp/option.h"
+#include <dhcp/dhcp6.h>
+#include <dhcp/pkt6.h>
+#include <dhcp/option.h>
 #include <iostream>
 #include <iostream>
 
 
 namespace isc {
 namespace isc {

+ 2 - 3
src/lib/dhcp/iface_mgr.cc

@@ -159,7 +159,7 @@ void IfaceMgr::detectIfaces() {
 }
 }
 #endif
 #endif
 
 
-bool IfaceMgr::openSockets6() {
+bool IfaceMgr::openSockets6(uint16_t port) {
     int sock;
     int sock;
 
 
     for (IfaceLst::iterator iface=ifaces_.begin();
     for (IfaceLst::iterator iface=ifaces_.begin();
@@ -175,8 +175,7 @@ bool IfaceMgr::openSockets6() {
                 continue;
                 continue;
             }
             }
 
 
-            sock = openSocket(iface->name_, *addr,
-                              DHCP6_SERVER_PORT);
+            sock = openSocket(iface->name_, *addr, port);
             if (sock<0) {
             if (sock<0) {
                 cout << "Failed to open unicast socket." << endl;
                 cout << "Failed to open unicast socket." << endl;
                 return (false);
                 return (false);

+ 3 - 2
src/lib/dhcp/iface_mgr.h

@@ -237,8 +237,9 @@ protected:
 
 
 private:
 private:
     /// Opens sockets on detected interfaces.
     /// 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)
     /// creates a single instance of this class (a singleton implementation)
     static void
     static void