[SCM] NSS Wrapper Repository - branch master updated
Andreas Schneider
asn at samba.org
Tue Apr 1 08:43:11 MDT 2014
The branch, master has been updated
via 4344cd3 tests: Check that the address has the correct family.
via 64d8672 nwrap: Set correct family for IPv6 address.
from cf26c91 tests: Add test that getaddrinfo() returns the IPv6 address.
http://gitweb.samba.org/?p=nss_wrapper.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 4344cd3d18e071a887bda79086035e8ba09f8222
Author: Andreas Schneider <asn at samba.org>
Date: Tue Apr 1 13:26:22 2014 +0200
tests: Check that the address has the correct family.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
commit 64d86726d2ea799537d9190112308c1e5c42f7c9
Author: Andreas Schneider <asn at samba.org>
Date: Tue Apr 1 13:27:11 2014 +0200
nwrap: Set correct family for IPv6 address.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Guenther Deschner <gd at samba.org>
-----------------------------------------------------------------------
Summary of changes:
src/nss_wrapper.c | 1 +
tests/test_getaddrinfo.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
Changeset truncated at 500 lines:
diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c
index d70dfb6..92e2bf7 100644
--- a/src/nss_wrapper.c
+++ b/src/nss_wrapper.c
@@ -3806,6 +3806,7 @@ static int nwrap_convert_he_ai(const struct hostent *he,
memset(sin6p, 0, sizeof(struct sockaddr_in6));
sin6p->sin6_port = htons(port);
+ sin6p->sin6_family = AF_INET6;
memcpy(&sin6p->sin6_addr, he->h_addr_list[0], he->h_length);
}
diff --git a/tests/test_getaddrinfo.c b/tests/test_getaddrinfo.c
index 724e970..ce06fd9 100644
--- a/tests/test_getaddrinfo.c
+++ b/tests/test_getaddrinfo.c
@@ -45,6 +45,8 @@ static void test_nwrap_getaddrinfo(void **state)
assert_int_equal(res->ai_family, AF_INET);
sinp = (struct sockaddr_in *)res->ai_addr;
+
+ assert_int_equal(sinp->sin_family, AF_INET);
ip = inet_ntoa(sinp->sin_addr);
assert_string_equal(ip, "127.0.0.11");
@@ -69,6 +71,8 @@ static void test_nwrap_getaddrinfo(void **state)
assert_int_equal(res->ai_family, AF_INET6);
sin6p = (struct sockaddr_in6 *)res->ai_addr;
+
+ assert_int_equal(sin6p->sin6_family, AF_INET6);
inet_ntop(AF_INET6, (void *)&sin6p->sin6_addr, ip6, sizeof(ip6));
assert_string_equal(ip6, "::13");
@@ -331,6 +335,7 @@ static void test_nwrap_getaddrinfo_ipv6(void **state)
assert_int_equal(res->ai_family, AF_INET6);
sin6p = (struct sockaddr_in6 *)res->ai_addr;
+ assert_int_equal(sin6p->sin6_family, AF_INET6);
inet_ntop(AF_INET6, (void *)&sin6p->sin6_addr, ip6, sizeof(ip6));
assert_string_equal(ip6, "::14");
--
NSS Wrapper Repository
More information about the samba-cvs
mailing list