BIND 10 rrl, updated. 9a811320414f0d0e8482660ce46572813fd821b6 [rrl] use a trivial wrapper for htonl().
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed May 8 17:31:26 UTC 2013
The branch, rrl has been updated
via 9a811320414f0d0e8482660ce46572813fd821b6 (commit)
from e0cc3a2ab227181f92a223e36b656fd5addb4fff (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 9a811320414f0d0e8482660ce46572813fd821b6
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed May 8 10:30:28 2013 -0700
[rrl] use a trivial wrapper for htonl().
some compilers/systems seem to define the original function in a tricky way,
preventing it from being used in a certain context. the wrapper works around
the issue.
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/rrl/tests/rrl_entry_unittest.cc | 11 +++++++++--
src/bin/auth/rrl/tests/rrl_key_unittest.cc | 9 +++++++--
src/bin/auth/rrl/tests/rrl_table_unittest.cc | 11 +++++++++--
src/bin/auth/rrl/tests/rrl_unittest.cc | 13 ++++++++++---
4 files changed, 35 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/rrl/tests/rrl_entry_unittest.cc b/src/bin/auth/rrl/tests/rrl_entry_unittest.cc
index 23047f4..d90ddd3 100644
--- a/src/bin/auth/rrl/tests/rrl_entry_unittest.cc
+++ b/src/bin/auth/rrl/tests/rrl_entry_unittest.cc
@@ -31,6 +31,8 @@
#include <vector>
+#include <arpa/inet.h>
+
using namespace isc::auth::rrl::detail;
using namespace isc::auth::rrl;
using namespace isc::dns;
@@ -40,8 +42,13 @@ using std::vector;
namespace {
-const uint32_t MASK4 = htonl(0xffffff00);
-const uint32_t MASK6[4] = { 0xffffffff, htonl(0xfffffff0), 0, 0 };
+uint32_t
+htonlWrapper(uint32_t val) {
+ return (htonl(val));
+}
+
+const uint32_t MASK4 = htonlWrapper(0xffffff00);
+const uint32_t MASK6[4] = { 0xffffffff, htonlWrapper(0xfffffff0), 0, 0 };
// For constructing TimestampBases; we don't need it in this test.
void noopCallback(size_t) {}
diff --git a/src/bin/auth/rrl/tests/rrl_key_unittest.cc b/src/bin/auth/rrl/tests/rrl_key_unittest.cc
index 31ea0f7..eac0e9a 100644
--- a/src/bin/auth/rrl/tests/rrl_key_unittest.cc
+++ b/src/bin/auth/rrl/tests/rrl_key_unittest.cc
@@ -36,8 +36,13 @@ using isc::asiolink::IOAddress;
namespace {
-const uint32_t MASK4 = htonl(0xffffff00);
-const uint32_t MASK6[4] = { 0xffffffff, htonl(0xfffffff0), 0, 0 };
+uint32_t
+htonlWrapper(uint32_t val) {
+ return (htonl(val));
+}
+
+const uint32_t MASK4 = htonlWrapper(0xffffff00);
+const uint32_t MASK6[4] = { 0xffffffff, htonlWrapper(0xfffffff0), 0, 0 };
class RRLKeyTest : public ::testing::Test {
protected:
diff --git a/src/bin/auth/rrl/tests/rrl_table_unittest.cc b/src/bin/auth/rrl/tests/rrl_table_unittest.cc
index 3ed852f..e8aeefc 100644
--- a/src/bin/auth/rrl/tests/rrl_table_unittest.cc
+++ b/src/bin/auth/rrl/tests/rrl_table_unittest.cc
@@ -29,6 +29,8 @@
#include <gtest/gtest.h>
+#include <arpa/inet.h>
+
using namespace isc::auth::rrl::detail;
using namespace isc::dns;
using isc::asiolink::IOEndpoint;
@@ -36,8 +38,13 @@ using isc::asiolink::IOAddress;
namespace {
-const uint32_t MASK4 = htonl(0xffffff00);
-const uint32_t MASK6[4] = { 0xffffffff, htonl(0xfffffff0), 0, 0 };
+uint32_t
+htonlWrapper(uint32_t val) {
+ return (htonl(val));
+}
+
+const uint32_t MASK4 = htonlWrapper(0xffffff00);
+const uint32_t MASK6[4] = { 0xffffffff, htonlWrapper(0xfffffff0), 0, 0 };
// For constructing TimestampBases; we don't need it in this test.
void noopCallback(size_t) {}
diff --git a/src/bin/auth/rrl/tests/rrl_unittest.cc b/src/bin/auth/rrl/tests/rrl_unittest.cc
index 9064a2f..16fa104 100644
--- a/src/bin/auth/rrl/tests/rrl_unittest.cc
+++ b/src/bin/auth/rrl/tests/rrl_unittest.cc
@@ -33,6 +33,8 @@
#include <cstring>
#include <vector>
+#include <arpa/inet.h>
+
using namespace isc::auth::rrl;
using namespace isc::dns;
using isc::asiolink::IOEndpoint;
@@ -40,8 +42,13 @@ using isc::asiolink::IOAddress;
namespace {
-const uint32_t MASK4 = htonl(0xffffff00);
-const uint32_t MASK6[4] = { 0xffffffff, htonl(0xffffff00), 0, 0 };
+uint32_t
+htonlWrapper(uint32_t val) {
+ return (htonl(val));
+}
+
+const uint32_t MASK4 = htonlWrapper(0xffffff00);
+const uint32_t MASK6[4] = { 0xffffffff, htonlWrapper(0xffffff00), 0, 0 };
class ResponseLimiterTest : public ::testing::Test {
protected:
@@ -114,7 +121,7 @@ TEST_F(ResponseLimiterTest, prefixes) {
&mask6[0], 16));
// mask ending with 1000 0000. also the prefix len is an odd number.
- EXPECT_EQ(htonl(0xffff8000),
+ EXPECT_EQ(htonlWrapper(0xffff8000),
ResponseLimiter(100, 50, 3, 4, 5, 15, 2, 17, 56, false, 10).
getIPv4Mask());
mask6.assign(7, 0xff);
More information about the bind10-changes
mailing list