summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2020-05-03 17:22:42 +0200
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2020-05-07 17:46:05 +0000
commitc0bd320920bc1b666730a9990c6b10364dc5cf93 (patch)
tree4b868545546abb702d193ed0281290885e4ce507
parenta2fb11fc34a1cf34fad7f8def5977828ee2bc27e (diff)
downloadlibnice-c0bd320920bc1b666730a9990c6b10364dc5cf93.tar.gz
conncheck: inbound stun on tcp passive pairs should trigger a check
An inbound stun request on a newly discovered pair should trigger a conncheck in the reverse direction, and not promote the pair directly in state succeeded. This is particulary required if the agent is in aggressive controlling mode.
-rw-r--r--agent/conncheck.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 67d4f5b..fc4a2b8 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -2086,12 +2086,9 @@ conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream,
break;
}
}
- if (pair == NULL) {
- pair = priv_conn_check_add_for_candidate_pair_matched (agent,
- stream->id, component, lcand, rcand, NICE_CHECK_SUCCEEDED);
- if (pair)
- pair->valid = TRUE;
- }
+ if (pair == NULL)
+ priv_conn_check_add_for_candidate_pair_matched (agent,
+ stream->id, component, lcand, rcand, NICE_CHECK_WAITING);
}
priv_schedule_triggered_check (agent, stream, component,
@@ -4837,16 +4834,11 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, NiceStream *stream,
remote_candidate2 ? remote_candidate2 : remote_candidate);
if(remote_candidate && stream->remote_ufrag[0]) {
if (local_candidate &&
- local_candidate->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE) {
- CandidateCheckPair *pair;
-
- pair = priv_conn_check_add_for_candidate_pair_matched (agent,
+ local_candidate->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE)
+ priv_conn_check_add_for_candidate_pair_matched (agent,
stream->id, component, local_candidate, remote_candidate,
- NICE_CHECK_SUCCEEDED);
- if (pair) {
- pair->valid = TRUE;
- }
- } else
+ NICE_CHECK_WAITING);
+ else
conn_check_add_for_candidate (agent, stream->id, component, remote_candidate);
}
}