From: JINMEI Tatuya Date: Tue, 22 May 2012 00:44:59 +0000 (-0700) Subject: [1539] use getSALength() instead of sa_len to calculate the length of sockaddr. X-Git-Tag: trac2351_base~226^2~85^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fedb6edd4f302d8be91ea704ac71ded40ed921f9;p=thirdparty%2Fkea.git [1539] use getSALength() instead of sa_len to calculate the length of sockaddr. the latter isn't very portable. --- diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc index 48756ac08a..0da8911c7d 100644 --- a/src/bin/auth/tests/auth_srv_unittest.cc +++ b/src/bin/auth/tests/auth_srv_unittest.cc @@ -16,6 +16,8 @@ #include +#include + #include #include #include @@ -56,6 +58,7 @@ using namespace std; using namespace isc::cc; using namespace isc::dns; using namespace isc::util; +using namespace isc::util::io::internal; using namespace isc::util::unittests; using namespace isc::dns::rdata; using namespace isc::data; @@ -1428,7 +1431,7 @@ checkAddrPort(const struct sockaddr& actual_sa, const string& expected_addr, uint16_t expected_port) { char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; - const int error = getnameinfo(&actual_sa, actual_sa.sa_len, hbuf, + const int error = getnameinfo(&actual_sa, getSALength(actual_sa), hbuf, sizeof(hbuf), sbuf, sizeof(sbuf), NI_NUMERICHOST | NI_NUMERICSERV); if (error != 0) {