Commit d66a3155 authored by Olivier Crête's avatar Olivier Crête

stunmessage: Revert another function to use sockaddr

The farstream unit tests were using it.
parent 8da016a7
......@@ -662,7 +662,7 @@ socket_send_message (NiceSocket *sock, const NiceAddress *to,
goto send;
}
if (stun_message_append_addr (&msg, STUN_ATTRIBUTE_DESTINATION_ADDRESS,
&sa.storage, sizeof(sa)) !=
&sa.addr, sizeof(sa)) !=
STUN_MESSAGE_RETURN_SUCCESS)
goto send;
......@@ -1831,7 +1831,7 @@ priv_add_channel_binding (TurnPriv *priv, const NiceAddress *peer)
if (stun_message_append_addr (&msg->message,
STUN_ATTRIBUTE_DESTINATION_ADDRESS,
&sa.storage, sizeof(sa))
&sa.addr, sizeof(sa))
!= STUN_MESSAGE_RETURN_SUCCESS) {
g_free (msg);
return FALSE;
......
......@@ -420,7 +420,7 @@ stun_message_append_string (StunMessage * msg, StunAttribute type,
StunMessageReturn
stun_message_append_addr (StunMessage *msg, StunAttribute type,
const struct sockaddr_storage *addr, socklen_t addrlen)
const struct sockaddr *addr, socklen_t addrlen)
{
const void *pa;
uint8_t *ptr;
......@@ -430,7 +430,7 @@ stun_message_append_addr (StunMessage *msg, StunAttribute type,
if ((size_t) addrlen < sizeof (struct sockaddr))
return STUN_MESSAGE_RETURN_INVALID;
switch (addr->ss_family)
switch (addr->sa_family)
{
case AF_INET:
{
......@@ -488,7 +488,8 @@ stun_message_append_xor_addr (StunMessage *msg, StunAttribute type,
if (val)
return val;
return stun_message_append_addr (msg, type, &tmpaddr, addrlen);
return stun_message_append_addr (msg, type, (struct sockaddr *) &tmpaddr,
addrlen);
}
StunMessageReturn
......@@ -508,7 +509,8 @@ stun_message_append_xor_addr_full (StunMessage *msg, StunAttribute type,
if (val)
return val;
return stun_message_append_addr (msg, type, &tmpaddr, addrlen);
return stun_message_append_addr (msg, type, (struct sockaddr *) &tmpaddr,
addrlen);
}
......
......@@ -795,7 +795,7 @@ StunMessageReturn stun_message_append_string (StunMessage *msg,
* %STUN_MESSAGE_RETURN_UNSUPPORTED_ADDRESS if the address family is unknown.
*/
StunMessageReturn stun_message_append_addr (StunMessage * msg,
StunAttribute type, const struct sockaddr_storage *addr, socklen_t addrlen);
StunAttribute type, const struct sockaddr *addr, socklen_t addrlen);
/**
* stun_message_append_xor_addr:
......
......@@ -146,7 +146,7 @@ check_af (const char *name, int family, socklen_t addrlen)
stun_agent_init_request (&agent, &msg, buf, sizeof(buf), STUN_BINDING);
if (stun_message_append_addr (&msg, STUN_ATTRIBUTE_MAPPED_ADDRESS,
&addr, addrlen) !=
(struct sockaddr *) &addr, addrlen) !=
STUN_MESSAGE_RETURN_UNSUPPORTED_ADDRESS)
fatal ("Unknown address family test failed");
if (stun_message_append_xor_addr (&msg, STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS,
......@@ -156,7 +156,8 @@ check_af (const char *name, int family, socklen_t addrlen)
addr.ss_family = family;
if (stun_message_append_addr (&msg, STUN_ATTRIBUTE_MAPPED_ADDRESS,
&addr, addrlen - 1) != STUN_MESSAGE_RETURN_INVALID)
(struct sockaddr *) &addr, addrlen - 1) !=
STUN_MESSAGE_RETURN_INVALID)
fatal ("Too small %s sockaddr test failed", name);
if (stun_message_append_xor_addr (&msg, STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS,
......@@ -164,7 +165,7 @@ check_af (const char *name, int family, socklen_t addrlen)
fatal ("Too small %s sockaddr xor test failed", name);
if (stun_message_append_addr (&msg, STUN_ATTRIBUTE_MAPPED_ADDRESS,
&addr, addrlen) != STUN_MESSAGE_RETURN_SUCCESS)
(struct sockaddr *) &addr, addrlen) != STUN_MESSAGE_RETURN_SUCCESS)
fatal ("%s sockaddr test failed", name);
if (stun_message_append_xor_addr (&msg, STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS,
......
......@@ -226,7 +226,7 @@ static int dgram_process (int sock, StunAgent *oldagent, StunAgent *newagent)
STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS, &addr.storage, addr_len);
else
stun_message_append_addr (&response, STUN_ATTRIBUTE_MAPPED_ADDRESS,
&addr.storage, addr_len);
&addr.addr, addr_len);
break;
case STUN_SHARED_SECRET:
......
......@@ -305,7 +305,7 @@ stun_usage_ice_conncheck_create_reply (StunAgent *agent, StunMessage *req,
src, srclen);
} else {
val = stun_message_append_addr (msg, STUN_ATTRIBUTE_MAPPED_ADDRESS,
src, srclen);
(struct sockaddr *) src, srclen);
}
if (val != STUN_MESSAGE_RETURN_SUCCESS) {
......
......@@ -195,7 +195,7 @@ recv_packet:
&addr.storage, addr_len);
else
stun_message_append_addr (&response, STUN_ATTRIBUTE_MAPPED_ADDRESS,
&addr.storage, addr_len);
&addr.addr, addr_len);
break;
case STUN_SHARED_SECRET:
......
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