BIND 10 trac1959, updated. 10cf1a64da6a0d8851984e6ca0c6c7baa6769c20 [1959] Added couple @todos for postponed things during review, part 1.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Sep 10 13:22:47 UTC 2012


The branch, trac1959 has been updated
       via  10cf1a64da6a0d8851984e6ca0c6c7baa6769c20 (commit)
      from  58131685191d678f16320f532d86ddc2a90211ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 10cf1a64da6a0d8851984e6ca0c6c7baa6769c20
Author: Tomek Mrugalski <tomasz at isc.org>
Date:   Mon Sep 10 15:22:30 2012 +0200

    [1959] Added couple @todos for postponed things during review, part 1.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dhcp/iface_mgr.cc |   12 +++++++++---
 src/lib/dhcp/iface_mgr.h  |    2 ++
 src/lib/dhcp/option.h     |    3 +++
 3 files changed, 14 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc
index 54db434..9c03794 100644
--- a/src/lib/dhcp/iface_mgr.cc
+++ b/src/lib/dhcp/iface_mgr.cc
@@ -498,11 +498,15 @@ IfaceMgr::getLocalAddress(const IOAddress& remote_addr, const uint16_t port) {
     asio::error_code err_code;
     // If remote address is broadcast address we have to
     // allow this on the socket.
-    if (remote_addr.getAddress().is_v4() && 
+    if (remote_addr.getAddress().is_v4() &&
         (remote_addr == IOAddress("255.255.255.255"))) {
         // Socket has to be open prior to setting the broadcast
         // option. Otherwise set_option will complain about
         // bad file descriptor.
+
+        // @todo: We don't specify interface in any way here. 255.255.255.255
+        // We can very easily end up with a socket working on a different
+        // interface.
         sock.open(asio::ip::udp::v4(), err_code);
         if (err_code) {
             isc_throw(Unexpected, "failed to open UDPv4 socket");
@@ -580,8 +584,10 @@ int IfaceMgr::openSocket6(Iface& iface, const IOAddress& addr, uint16_t port) {
     struct sockaddr_in6 addr6;
     memset(&addr6, 0, sizeof(addr6));
     addr6.sin6_family = AF_INET6;
-    addr6.sin6_port = htons(port);    if (addr.toText() != "::1")
-      addr6.sin6_scope_id = if_nametoindex(iface.getName().c_str());
+    addr6.sin6_port = htons(port);
+    if (addr.toText() != "::1") {
+        addr6.sin6_scope_id = if_nametoindex(iface.getName().c_str());
+    }
 
     memcpy(&addr6.sin6_addr,
            addr.getAddress().to_v6().to_bytes().data(),
diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h
index 178d24a..cacd720 100644
--- a/src/lib/dhcp/iface_mgr.h
+++ b/src/lib/dhcp/iface_mgr.h
@@ -72,8 +72,10 @@ public:
     };
 
     /// type that holds a list of socket informations
+    /// @todo: Add SocketCollectionConstIter type
     typedef std::list<SocketInfo> SocketCollection;
 
+
     /// @brief represents a single network interface
     ///
     /// Iface structure represents network interface with all useful
diff --git a/src/lib/dhcp/option.h b/src/lib/dhcp/option.h
index 9589c37..080a869 100644
--- a/src/lib/dhcp/option.h
+++ b/src/lib/dhcp/option.h
@@ -63,6 +63,9 @@ public:
     /// @param type option type
     /// @param buf pointer to a buffer
     ///
+    /// @todo Passing a separate buffer for each option means that a copy
+    ///       was done. We can avoid it by passing 2 iterators.
+    ///
     /// @return a pointer to a created option object
     typedef OptionPtr Factory(Option::Universe u, uint16_t type, const OptionBuffer& buf);
 



More information about the bind10-changes mailing list