BIND 10 master, updated. 07ecaaf4703d817b1c7716da17db8c67c06eb7e1 [master] customize check logic against extra space for in::A based on inet_pton
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Feb 26 23:22:57 UTC 2013
The branch, master has been updated
via 07ecaaf4703d817b1c7716da17db8c67c06eb7e1 (commit)
from 66535ab575959e34b9405006257f5e3dd8910e9b (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 07ecaaf4703d817b1c7716da17db8c67c06eb7e1
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Tue Feb 26 15:20:44 2013 -0800
[master] customize check logic against extra space for in::A based on inet_pton
this will avoid unittest failure on netbsd, whose inet_pton behaves
differently than others:
http://git.bind10.isc.org/~tester/builder//BIND10/20130226211101-NetBSD6-i386-GCC/logs/unittests.out
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/tests/rdata_in_a_unittest.cc | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/rdata_in_a_unittest.cc b/src/lib/dns/tests/rdata_in_a_unittest.cc
index ac05c2c..3f65641 100644
--- a/src/lib/dns/tests/rdata_in_a_unittest.cc
+++ b/src/lib/dns/tests/rdata_in_a_unittest.cc
@@ -30,6 +30,9 @@
#include <sstream>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+
using isc::UnitTestUtil;
using namespace std;
using namespace isc::dns;
@@ -67,13 +70,21 @@ TEST_F(Rdata_IN_A_Test, createFromText) {
// or any meaningless text as an IP address
checkFromTextIN_A("xxx");
+ // NetBSD's inet_pton accepts trailing space after an IPv4 address, which
+ // would confuse some of the tests below. We check the case differently
+ // in these cases depending on the strictness of inet_pton (most
+ // implementations seem to be stricter).
+ uint8_t v4addr_buf[4];
+ const bool reject_extra_space =
+ inet_pton(AF_INET, "192.0.2.1 ", v4addr_buf) == 0;
+
// trailing white space: only string version throws
- checkFromTextIN_A("192.0.2.1 ", true, false);
+ checkFromTextIN_A("192.0.2.1 ", reject_extra_space, false);
// same for beginning white space.
checkFromTextIN_A(" 192.0.2.1", true, false);
// same for trailing non-space garbage (note that lexer version still
// ignore it; it's expected to be detected at a higher layer).
- checkFromTextIN_A("192.0.2.1 xxx", true, false);
+ checkFromTextIN_A("192.0.2.1 xxx", reject_extra_space, false);
// nul character after a valid textual representation.
string nul_after_addr = "192.0.2.1";
More information about the bind10-changes
mailing list