Commit ed75d55c authored by Jakub Adam's avatar Jakub Adam Committed by Philip Withnall

agent: fix relay candidate discovery on hosts having several IPs

When a message is received from a TURN server and we manage to find a
local relay candidate with matching stream and component IDs, we should
also check whether the message came from the candidate's respective
socket.

We should do this because there might still be some pending TURN
candidate discovery with the same server from a different local host IP
and the message may be a response to our allocate request. If
nice_udp_turn_socket_parse_recv_message() is passed such request, it can
make some wrong assumptions and modify it like in the case of reliable
UDP-TURN-OVER-TCP by removing (supposed) RFC4571 framing, which in turn
causes the reply to be unrecognized and discarded.

Because of this, any subsequent replies following the first successful
allocate response from that server couldn't create any additional relay
candidates.

Maniphest Tasks: https://phabricator.freedesktop.org/T7336Reviewed-by: default avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D786
parent 1493a381
......@@ -3574,7 +3574,8 @@ agent_recv_message_unlocked (
if (cand->type == NICE_CANDIDATE_TYPE_RELAYED &&
cand->stream_id == stream->id &&
cand->component_id == component->id) {
cand->component_id == component->id &&
nice_socket_is_base_of (nicesock, cand->sockptr)) {
retval = nice_udp_turn_socket_parse_recv_message (cand->sockptr, &nicesock,
message);
break;
......
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