conncheck: test incoming checks on candidate base address
authorFabrice Bellet <fabrice@bellet.info>
Wed, 12 Jun 2019 19:44:48 +0000 (21:44 +0200)
committerOlivier CrĂȘte <olivier.crete@collabora.com>
Thu, 4 Jul 2019 21:03:43 +0000 (17:03 -0400)
The candidate may be a newly discovered peer reflexive one,
or a server reflexive initial candidate, where address and
base address differ. Early incoming checks are received on
the base address. These incoming checks may accumulate if remote
credentials arrive with a delay.

agent/conncheck.c

index 97019d5..068705d 100644 (file)
@@ -1727,8 +1727,14 @@ conn_check_remote_candidates_set(NiceAgent *agent, NiceStream *stream,
       if (nice_address_equal (&rcand->addr, &icheck->from)) {
         for (m = component->local_candidates; m; m = m->next) {
           NiceCandidate *cand = m->data;
+          NiceAddress *addr;
 
-          if (nice_address_equal (&cand->addr, &icheck->local_socket->addr)) {
+          if (cand->type == NICE_CANDIDATE_TYPE_RELAYED)
+            addr = &cand->addr;
+          else
+            addr = &cand->base_addr;
+
+          if (nice_address_equal (addr, &icheck->local_socket->addr)) {
             lcand = cand;
             break;
           }