--- a/src/agent.c +++ b/src/agent.c @@ -1437,7 +1437,20 @@ return -1; ice_candidate_pair_t *pair = entry->pair; - if (msg->ice_controlling == msg->ice_controlled) { + // Poyta Stream (D113): a request authenticated with the ICE password but carrying neither + // ICE-CONTROLLING nor ICE-CONTROLLED cannot cause a role conflict. Answering 400 makes the + // browser destroy the candidate pair, and the connection never finishes, so it is answered + // like any other check. The details are logged to find out who sends it. + const bool no_role = !msg->ice_controlling && !msg->ice_controlled; + if (no_role) { + char src_str[ADDR_MAX_STRING_LEN]; + addr_record_to_string(src, src_str, ADDR_MAX_STRING_LEN); + JLOG_WARN("STUN Binding request without role: integrity=%d, relayed=%d, nominate=%d, " + "priority=%u, from %s", + msg->has_integrity ? 1 : 0, relayed ? 1 : 0, msg->use_candidate ? 1 : 0, + (unsigned int)msg->priority, src_str); + } + if (msg->ice_controlling == msg->ice_controlled && !(no_role && msg->has_integrity)) { JLOG_WARN("Controlling and controlled attributes mismatch in request"); agent_send_stun_binding(agent, entry, STUN_CLASS_RESP_ERROR, 400, msg->transaction_id, NULL);