diff options
author | Jakub Adam <jakub.adam@ktknet.cz> | 2016-03-02 00:01:19 +0000 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2016-03-02 00:02:59 +0000 |
commit | ed75d55cf279613bb736f7646d3010d816797ddf (patch) | |
tree | 5b7adb9d652748a7732dd7dcbb615decbe036a7e /agent/agent.c | |
parent | 1493a381d5bf6e15348c2bc17270f45b69cb70d2 (diff) | |
download | libnice-ed75d55cf279613bb736f7646d3010d816797ddf.tar.gz |
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/T7336
Reviewed-by: Olivier CrĂȘte <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D786
Diffstat (limited to 'agent/agent.c')
-rw-r--r-- | agent/agent.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/agent/agent.c b/agent/agent.c index 388e690..fc32515 100644 --- a/agent/agent.c +++ b/agent/agent.c @@ -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; |