BIND 10 trac1534, updated. ffd2c98603eb6db553d4cf18d2fd7ac29a62080f [1534] Use the other methods of setting it as fallback

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Feb 27 13:01:11 UTC 2012


The branch, trac1534 has been updated
       via  ffd2c98603eb6db553d4cf18d2fd7ac29a62080f (commit)
      from  bc4fc1865977c94d4ad6eddf0cf96a7881a71536 (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 ffd2c98603eb6db553d4cf18d2fd7ac29a62080f
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Feb 27 13:57:34 2012 +0100

    [1534] Use the other methods of setting it as fallback
    
    Meaning if it works, don't try the others. Also, a little comment in
    test was added.

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

Summary of changes:
 src/bin/sockcreator/sockcreator.cc             |    3 ++-
 src/bin/sockcreator/tests/sockcreator_tests.cc |    6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/sockcreator/sockcreator.cc b/src/bin/sockcreator/sockcreator.cc
index e87a310..2dda99b 100644
--- a/src/bin/sockcreator/sockcreator.cc
+++ b/src/bin/sockcreator/sockcreator.cc
@@ -178,7 +178,7 @@ mtu(int fd) {
     if (setsockopt(fd, IPPROTO_IPV6, IPV6_USE_MIN_MTU, &on, sizeof(on)) < 0) {
         return (-2);
     }
-#endif
+#else // Try the following as fallback
 #ifdef IPV6_MTU
     // Use minimum MTU on systems that don't have the IPV6_USE_MIN_MTU
     const int mtu = 1280;
@@ -195,6 +195,7 @@ mtu(int fd) {
         return (-2);
     }
 #endif
+#endif
     return (fd);
 }
 
diff --git a/src/bin/sockcreator/tests/sockcreator_tests.cc b/src/bin/sockcreator/tests/sockcreator_tests.cc
index a100cc2..9bbb789 100644
--- a/src/bin/sockcreator/tests/sockcreator_tests.cc
+++ b/src/bin/sockcreator/tests/sockcreator_tests.cc
@@ -125,7 +125,7 @@ void addressFamilySpecificCheck(const sockaddr_in6*, const int socknum,
         EXPECT_EQ(getsockopt(socknum, IPPROTO_IPV6, IPV6_USE_MIN_MTU, &options,
                              &len)) << strerror(errno);
         EXPECT_NE(0, options);
-#endif
+#else
         // We do not check for the IPV6_MTU, because while setting works (eg.
         // the packets are fragmented correctly), the getting does not. If
         // we try to getsockopt it, an error complaining it can't be accessed
@@ -138,6 +138,7 @@ void addressFamilySpecificCheck(const sockaddr_in6*, const int socknum,
                                 &options, &len)) << strerror(errno);
         EXPECT_EQ(IPV6_PMTUDISC_DONT, options);
 #endif
+#endif
     }
 }
 
@@ -204,6 +205,9 @@ TEST(get_sock, tcp6_create) {
 
 bool close_called(false);
 
+// You can use it as a close mockup. If you care about checking if it was really
+// called, you can use the close_called variable. But set it to false before the
+// test.
 int closeCall(int socket) {
     close(socket);
     close_called = true;



More information about the bind10-changes mailing list