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