Commit d420b495 authored by Youness Alaoui's avatar Youness Alaoui Committed by Youness Alaoui
Browse files

Use sockaddr for stun_usage_bind_process in unit test

parent a37df060
......@@ -232,7 +232,8 @@ static void bad_responses (void)
assert (stun_agent_validate (&agent, &msg, buf, len, NULL, NULL)
== STUN_VALIDATION_SUCCESS);
val = stun_usage_bind_process (&msg, &addr, &addrlen, &addr, &addrlen);
val = stun_usage_bind_process (&msg, (struct sockaddr *) &addr, &addrlen,
(struct sockaddr *) &addr, &addrlen);
assert (val == STUN_USAGE_BIND_RETURN_INVALID);
/* Send response with wrong request type */
......@@ -241,7 +242,8 @@ static void bad_responses (void)
/* Send error response without ERROR-CODE */
buf[1] |= 0x10;
val = stun_usage_bind_process (&msg, &addr, &addrlen, &addr, &addrlen);
val = stun_usage_bind_process (&msg, (struct sockaddr *) &addr, &addrlen,
(struct sockaddr *) &addr, &addrlen);
assert (val == STUN_USAGE_BIND_RETURN_INVALID);
close (fd);
......@@ -310,7 +312,8 @@ static void responses (void)
val = getsockname (servfd, (struct sockaddr *)&addr, &addrlen);
assert (val == 0);
val = stun_usage_bind_process (&msg, &addr, &addrlen, &addr, &addrlen);
val = stun_usage_bind_process (&msg, (struct sockaddr *) &addr, &addrlen,
(struct sockaddr *) &addr, &addrlen);
assert (val == STUN_USAGE_BIND_RETURN_ERROR);
/* Send response with a no mapped address at all */
......@@ -340,7 +343,8 @@ static void responses (void)
val = getsockname (servfd, (struct sockaddr *)&addr, &addrlen);
assert (val == 0);
val = stun_usage_bind_process (&msg, &addr, &addrlen, &addr, &addrlen);
val = stun_usage_bind_process (&msg, (struct sockaddr *) &addr, &addrlen,
(struct sockaddr *) &addr, &addrlen);
assert (val == STUN_USAGE_BIND_RETURN_ERROR);
/* Send old-style response */
......@@ -362,7 +366,7 @@ static void responses (void)
stun_agent_init_response (&agent, &msg, buf, sizeof (buf), &msg);
assert (stun_message_append_addr (&msg, STUN_ATTRIBUTE_MAPPED_ADDRESS,
&addr, addrlen) == STUN_MESSAGE_RETURN_SUCCESS);
(struct sockaddr *) &addr, addrlen) == STUN_MESSAGE_RETURN_SUCCESS);
len = stun_agent_finish_message (&agent, &msg, NULL, 0);
assert (len > 0);
......@@ -372,7 +376,8 @@ static void responses (void)
val = getsockname (servfd, (struct sockaddr *)&addr, &addrlen);
assert (val == 0);
val = stun_usage_bind_process (&msg, &addr, &addrlen, &addr, &addrlen);
val = stun_usage_bind_process (&msg, (struct sockaddr *) &addr, &addrlen,
(struct sockaddr *) &addr, &addrlen);
assert (val == STUN_USAGE_BIND_RETURN_SUCCESS);
/* End */
......
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