Commit 19fd43f7 authored by Andreas Schneider's avatar Andreas Schneider

tests: Rename s_addr to send_addr

The preprocessor on Solaris replaces s_addr with S_un.S_addr.
Signed-off-by: default avatarAndreas Schneider <asn@samba.org>
parent cf8fc6d9
......@@ -193,7 +193,7 @@ static void test_sendmsg_recvmsg_ipv6(void **state)
static void test_sendmsg_recvmsg_ipv4_null(void **state)
{
struct torture_address s_addr = {
struct torture_address send_addr = {
.sa_socklen = sizeof(struct sockaddr_storage),
};
struct msghdr s_msg = {
......@@ -213,15 +213,15 @@ static void test_sendmsg_recvmsg_ipv4_null(void **state)
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
assert_int_not_equal(s, -1);
s_addr.sa.in.sin_family = AF_INET;
s_addr.sa.in.sin_port = htons(torture_server_port());
send_addr.sa.in.sin_family = AF_INET;
send_addr.sa.in.sin_port = htons(torture_server_port());
rc = inet_pton(AF_INET,
torture_server_address(AF_INET),
&s_addr.sa.in.sin_addr);
&send_addr.sa.in.sin_addr);
assert_int_equal(rc, 1);
rc = connect(s, &s_addr.sa.s, s_addr.sa_socklen);
rc = connect(s, &send_addr.sa.s, send_addr.sa_socklen);
/* msg_name = NULL */
......
......@@ -197,7 +197,7 @@ static void test_sendmsg_recvmsg_ipv6(void **state)
static void test_sendmsg_recvmsg_ipv4_connected(void **state)
{
struct torture_address s_addr = {
struct torture_address send_addr = {
.sa_socklen = sizeof(struct sockaddr_storage),
};
struct torture_address r_addr = {
......@@ -222,15 +222,15 @@ static void test_sendmsg_recvmsg_ipv4_connected(void **state)
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
assert_int_not_equal(s, -1);
s_addr.sa.in.sin_family = AF_INET;
s_addr.sa.in.sin_port = htons(torture_server_port());
send_addr.sa.in.sin_family = AF_INET;
send_addr.sa.in.sin_port = htons(torture_server_port());
rc = inet_pton(AF_INET,
torture_server_address(AF_INET),
&s_addr.sa.in.sin_addr);
&send_addr.sa.in.sin_addr);
assert_int_equal(rc, 1);
rc = connect(s, &s_addr.sa.s, s_addr.sa_socklen);
rc = connect(s, &send_addr.sa.s, send_addr.sa_socklen);
iov.iov_base = (void *)payload;
iov.iov_len = sizeof(payload);
......@@ -265,7 +265,7 @@ static void test_sendmsg_recvmsg_ipv4_connected(void **state)
static void test_sendmsg_recvmsg_ipv4_connected_null(void **state)
{
struct torture_address s_addr = {
struct torture_address send_addr = {
.sa_socklen = sizeof(struct sockaddr_storage),
};
struct msghdr s_msg = {
......@@ -285,15 +285,15 @@ static void test_sendmsg_recvmsg_ipv4_connected_null(void **state)
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
assert_int_not_equal(s, -1);
s_addr.sa.in.sin_family = AF_INET;
s_addr.sa.in.sin_port = htons(torture_server_port());
send_addr.sa.in.sin_family = AF_INET;
send_addr.sa.in.sin_port = htons(torture_server_port());
rc = inet_pton(AF_INET,
torture_server_address(AF_INET),
&s_addr.sa.in.sin_addr);
&send_addr.sa.in.sin_addr);
assert_int_equal(rc, 1);
rc = connect(s, &s_addr.sa.s, s_addr.sa_socklen);
rc = connect(s, &send_addr.sa.s, send_addr.sa_socklen);
/* msg_name = NULL */
......@@ -324,7 +324,7 @@ static void test_sendmsg_recvmsg_ipv4_connected_null(void **state)
static void test_sendmsg_recvmsg_ipv4_connected_namelen(void **state)
{
struct torture_address s_addr = {
struct torture_address send_addr = {
.sa_socklen = sizeof(struct sockaddr_storage),
};
struct msghdr s_msg = {
......@@ -344,15 +344,15 @@ static void test_sendmsg_recvmsg_ipv4_connected_namelen(void **state)
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
assert_int_not_equal(s, -1);
s_addr.sa.in.sin_family = AF_INET;
s_addr.sa.in.sin_port = htons(torture_server_port());
send_addr.sa.in.sin_family = AF_INET;
send_addr.sa.in.sin_port = htons(torture_server_port());
rc = inet_pton(AF_INET,
torture_server_address(AF_INET),
&s_addr.sa.in.sin_addr);
&send_addr.sa.in.sin_addr);
assert_int_equal(rc, 1);
rc = connect(s, &s_addr.sa.s, s_addr.sa_socklen);
rc = connect(s, &send_addr.sa.s, send_addr.sa_socklen);
/* msg_name = NULL */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment