aboutsummaryrefslogtreecommitdiff
path: root/tests/tcp6.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-03-14 15:40:46 -0700
committerGarrett D'Amore <garrett@damore.org>2018-03-14 17:16:39 -0700
commit85ccb0066a86a3558ae81cd357463f8dc631f94b (patch)
tree15838902439f6ed188ffb70fe2170605f26894bc /tests/tcp6.c
parentf4de6b5302df8befbd2b229b701d0bf9ca81a5fb (diff)
downloadnng-85ccb0066a86a3558ae81cd357463f8dc631f94b.tar.gz
nng-85ccb0066a86a3558ae81cd357463f8dc631f94b.tar.bz2
nng-85ccb0066a86a3558ae81cd357463f8dc631f94b.zip
fixes #289 nng_sockaddr could just be a union
fixes #290 sockaddr improvements
Diffstat (limited to 'tests/tcp6.c')
-rw-r--r--tests/tcp6.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/tcp6.c b/tests/tcp6.c
index c00f00f2..07990a36 100644
--- a/tests/tcp6.c
+++ b/tests/tcp6.c
@@ -1,6 +1,6 @@
//
-// Copyright 2017 Garrett D'Amore <garrett@damore.org>
-// Copyright 2017 Capitar IT Group BV <info@capitar.com>
+// Copyright 2018 Staysail Systems, Inc. <info@staystail.tech>
+// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -24,10 +24,10 @@ has_v6(void)
nni_plat_udp *u;
int rv;
- sa.s_un.s_in6.sa_family = NNG_AF_INET6;
- sa.s_un.s_in6.sa_port = 0;
- memset(sa.s_un.s_in6.sa_addr, 0, 16);
- sa.s_un.s_in6.sa_addr[15] = 1;
+ sa.s_in6.sa_family = NNG_AF_INET6;
+ sa.s_in6.sa_port = 0;
+ memset(sa.s_in6.sa_addr, 0, 16);
+ sa.s_in6.sa_addr[15] = 1;
rv = nni_plat_udp_open(&u, &sa);
if (rv == 0) {
@@ -52,10 +52,10 @@ check_props_v6(nng_msg *msg)
So(p > 0);
So(nng_pipe_getopt(p, NNG_OPT_LOCADDR, &la, &z) == 0);
So(z == sizeof(la));
- So(la.s_un.s_family == NNG_AF_INET6);
- // So(la.s_un.s_in.sa_port == (trantest_port - 1));
- So(la.s_un.s_in6.sa_port != 0);
- So(memcmp(la.s_un.s_in6.sa_addr, loopback, 16) == 0);
+ So(la.s_family == NNG_AF_INET6);
+ // So(la.s_in.sa_port == (trantest_port - 1));
+ So(la.s_in6.sa_port != 0);
+ So(memcmp(la.s_in6.sa_addr, loopback, 16) == 0);
});
Convey("IPv6 Remote address property works", {
@@ -65,9 +65,9 @@ check_props_v6(nng_msg *msg)
So(p > 0);
So(nng_pipe_getopt(p, NNG_OPT_REMADDR, &ra, &z) == 0);
So(z == sizeof(ra));
- So(ra.s_un.s_family == NNG_AF_INET6);
- So(ra.s_un.s_in6.sa_port != 0);
- So(memcmp(ra.s_un.s_in6.sa_addr, loopback, 16) == 0);
+ So(ra.s_family == NNG_AF_INET6);
+ So(ra.s_in6.sa_port != 0);
+ So(memcmp(ra.s_in6.sa_addr, loopback, 16) == 0);
});
Convey("Malformed TCPv6 addresses do not panic", {