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.
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;
}