1
0
mirror of https://github.com/coturn/coturn.git synced 2026-04-03 11:21:00 +02:00
Carlos Ruiz Ballesteros a4756d482f
fix: restore RFC 3489 (old STUN) backward compatibility broken since 4.7.0 (#1839)
## Problem

Since 4.7.0, `--stun-backward-compatibility` no longer works. Legacy
STUN clients (RFC 3489, pre-magic-cookie) receive no response even when
the option is explicitly enabled.

## Root Cause

Commit 4cc076d renamed `no_stun_backward_compatibility` (negative logic)
to `stun_backward_compatibility` (positive logic). Two call sites were
not updated correctly:

1. **`src/server/ns_turn_server.c`**: the
`old_stun_is_command_message_str` branch in the TCP/stream socket
handler kept `!` on the renamed variable, inverting the condition. Old
STUN was processed only when backward compat was *off*.

2. **`src/apps/relay/dtls_listener.c`**: the UDP/DTLS early packet
validation block never included an `old_stun_is_command_message_str`
check, so old STUN packets were always classified as invalid regardless
of the backward compat flag.

## Fix

- **`ns_turn_server.c`**: Remove the stray `!` negation restoring
correct condition semantics.
- **`dtls_listener.c`**: Add the missing old-STUN branch in the UDP
packet validation block, guarded by
`turn_params.stun_backward_compatibility`.
2026-03-25 23:16:21 -07:00
..
2025-05-30 14:13:59 -07:00
2026-02-23 17:04:31 -08:00