BIND 10 trac1452, updated. 6328a99430a833f72c7faa3515cde78e49b5de12 [trac1452] made sure hints are used in getaddrinfo, also be more specific about hints.ai_socktype

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Dec 12 21:14:47 UTC 2011


The branch, trac1452 has been updated
       via  6328a99430a833f72c7faa3515cde78e49b5de12 (commit)
      from  e0c434fbb5e15c98af42b86248b3de1472a4a7b0 (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 6328a99430a833f72c7faa3515cde78e49b5de12
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Dec 12 21:14:09 2011 +0000

    [trac1452] made sure hints are used in getaddrinfo, also be more specific
    about hints.ai_socktype

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

Summary of changes:
 src/lib/util/tests/socketsession_unittest.cc |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/util/tests/socketsession_unittest.cc b/src/lib/util/tests/socketsession_unittest.cc
index e7b76e9..2bb42b2 100644
--- a/src/lib/util/tests/socketsession_unittest.cc
+++ b/src/lib/util/tests/socketsession_unittest.cc
@@ -164,8 +164,15 @@ protected:
         struct addrinfo hints, *res;
         memset(&hints, 0, sizeof(hints));
         hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
-        EXPECT_EQ(0, getaddrinfo(addr_str.c_str(), port_str.c_str(), NULL,
-                                 &res));
+        hints.ai_family = AF_UNSPEC;
+        hints.ai_socktype = SOCK_DGRAM;
+        const int error = getaddrinfo(addr_str.c_str(), port_str.c_str(),
+                                      &hints, &res);
+        if (error != 0) {
+            isc_throw(isc::Unexpected, "getaddrinfo failed for " <<
+                      addr_str << ", " << port_str << ": " <<
+                      gai_strerror(error));
+        }
         addrinfo_list_.push_back(res);
         return (SockAddrInfo(res->ai_addr, res->ai_addrlen));
     }




More information about the bind10-changes mailing list