Skip to content

Commit

Permalink
Only send STUN USE_CANDIDATE if controlling Agent
Browse files Browse the repository at this point in the history
Pion's STUN implementation rejects this as invalid
  • Loading branch information
Sean-Der committed Sep 19, 2024
1 parent f59edd9 commit 2ba058d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ static void agent_create_binding_request(Agent* agent, StunMessage* msg) {
snprintf(username, sizeof(username), "%s:%s", agent->remote_ufrag, agent->local_ufrag);
stun_msg_write_attr(msg, STUN_ATTR_TYPE_USERNAME, strlen(username), username);
stun_msg_write_attr(msg, STUN_ATTR_TYPE_PRIORITY, 4, (char*)&agent->nominated_pair->priority);
stun_msg_write_attr(msg, STUN_ATTR_TYPE_USE_CANDIDATE, 0, NULL);
if (agent->mode == AGENT_MODE_CONTROLLING) {
stun_msg_write_attr(msg, STUN_ATTR_TYPE_USE_CANDIDATE, 0, NULL);
}
stun_msg_write_attr(msg, STUN_ATTR_TYPE_ICE_CONTROLLED, 8, (char*)&tie_breaker);
stun_msg_finish(msg, STUN_CREDENTIAL_SHORT_TERM, agent->remote_upwd, strlen(agent->remote_upwd));
}
Expand Down

0 comments on commit 2ba058d

Please sign in to comment.