diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-03 08:29:55 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-03 08:30:34 -0800 |
| commit | 8249242a9325a27e57107d78bfa168e918cc4f7a (patch) | |
| tree | 3fa7a7a0dd66c23684b731f6b2686e9b6ea7a574 /tests/tcp6.c | |
| parent | a5807e45b1badfb5d0cb4f697e1873a8ece59a30 (diff) | |
| download | nng-8249242a9325a27e57107d78bfa168e918cc4f7a.tar.gz nng-8249242a9325a27e57107d78bfa168e918cc4f7a.tar.bz2 nng-8249242a9325a27e57107d78bfa168e918cc4f7a.zip | |
Remove untyped nng_pipe_get, support for untyped sockaddr set.
This is a step on the path to removing unsafe untyped option accesses.
Diffstat (limited to 'tests/tcp6.c')
| -rw-r--r-- | tests/tcp6.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/tcp6.c b/tests/tcp6.c index 3822fd80..79e6fa47 100644 --- a/tests/tcp6.c +++ b/tests/tcp6.c @@ -42,7 +42,6 @@ static int check_props_v6(nng_msg *msg) { nng_pipe p; - size_t z; uint8_t loopback[16]; memset(loopback, 0, sizeof(loopback)); @@ -50,11 +49,9 @@ check_props_v6(nng_msg *msg) // IPv6 Local address property works nng_sockaddr la; - z = sizeof(nng_sockaddr); p = nng_msg_get_pipe(msg); So(nng_pipe_id(p) > 0); - So(nng_pipe_get(p, NNG_OPT_LOCADDR, &la, &z) == 0); - So(z == sizeof(la)); + So(nng_pipe_get_addr(p, NNG_OPT_LOCADDR, &la) == 0); So(la.s_family == NNG_AF_INET6); // So(la.s_in.sa_port == (trantest_port - 1)); So(la.s_in6.sa_port != 0); @@ -62,11 +59,9 @@ check_props_v6(nng_msg *msg) // IPv6 Remote address property works nng_sockaddr ra; - z = sizeof(nng_sockaddr); p = nng_msg_get_pipe(msg); So(nng_pipe_id(p) > 0); - So(nng_pipe_get(p, NNG_OPT_REMADDR, &ra, &z) == 0); - So(z == sizeof(ra)); + So(nng_pipe_get_addr(p, NNG_OPT_REMADDR, &ra) == 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); |
