Commit d79f997e authored by Youness Alaoui's avatar Youness Alaoui

Refuse to create a permission without a peer instead of not sending the XOR_PEER_ADDRESS

parent b0a68608
...@@ -224,15 +224,16 @@ size_t stun_usage_turn_create_permission (StunAgent *agent, StunMessage *msg, ...@@ -224,15 +224,16 @@ size_t stun_usage_turn_create_permission (StunAgent *agent, StunMessage *msg,
struct sockaddr *peer, struct sockaddr *peer,
StunUsageTurnCompatibility compatibility) StunUsageTurnCompatibility compatibility)
{ {
if (!peer)
return 0;
stun_agent_init_request (agent, msg, buffer, buffer_len, stun_agent_init_request (agent, msg, buffer, buffer_len,
STUN_CREATEPERMISSION); STUN_CREATEPERMISSION);
/* PEER address */ /* PEER address */
if (peer) { if (stun_message_append_xor_addr (msg, STUN_ATTRIBUTE_XOR_PEER_ADDRESS,
if (stun_message_append_xor_addr (msg, STUN_ATTRIBUTE_XOR_PEER_ADDRESS, peer, sizeof(*peer)) != STUN_MESSAGE_RETURN_SUCCESS) {
peer, sizeof(*peer)) != STUN_MESSAGE_RETURN_SUCCESS) { return 0;
return 0;
}
} }
/* nonce */ /* nonce */
......
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