Summary
src/masque/relay_server.rs:457 has a forward_datagram() method that is a no-op stub — it validates the session, checks rate limits, records stats, but never actually forwards the datagram to the target. The _target: SocketAddr parameter is prefixed with underscore and ignored entirely.
pub async fn forward_datagram(
&self,
client_addr: SocketAddr,
_target: SocketAddr, // ← ignored
payload: Bytes,
) -> RelayResult<()> {
// ... session lookup, rate limit, stats ...
Ok(()) // ← never forwards anything
}
Why this matters
The doc comment says "used for testing" but it's misleading:
- It gives the impression the relay data plane works when it doesn't (for this method)
- The real relay data plane uses
handle_client_datagram() and handle_target_datagram() which are properly implemented
- The test in
tests/ipv4_ipv6_bridging_tests.rs calls forward_datagram and appears to test relay forwarding, but is actually only testing rate limiting on a no-op
- This same stub exists in upstream ant-quic and caused confusion when investigating NAT traversal issues
Suggested action
Either:
- Remove it — the real data plane is
handle_client_datagram/handle_target_datagram
- Or implement it properly — actually forward the datagram to the target via the session's UDP socket, if there's a test use case that needs it
The bridging test should be updated either way to use the real data plane methods.
Context
Came up while investigating symmetric NAT connectivity. Chris's hole-punching work (PRs #25, #26, #27) correctly uses the PUNCH_ME_NOW coordination path, not this stub. But the stub's existence is a footgun for anyone reading the relay code.
cc @jacderida
Summary
src/masque/relay_server.rs:457has aforward_datagram()method that is a no-op stub — it validates the session, checks rate limits, records stats, but never actually forwards the datagram to the target. The_target: SocketAddrparameter is prefixed with underscore and ignored entirely.Why this matters
The doc comment says "used for testing" but it's misleading:
handle_client_datagram()andhandle_target_datagram()which are properly implementedtests/ipv4_ipv6_bridging_tests.rscallsforward_datagramand appears to test relay forwarding, but is actually only testing rate limiting on a no-opSuggested action
Either:
handle_client_datagram/handle_target_datagramThe bridging test should be updated either way to use the real data plane methods.
Context
Came up while investigating symmetric NAT connectivity. Chris's hole-punching work (PRs #25, #26, #27) correctly uses the PUNCH_ME_NOW coordination path, not this stub. But the stub's existence is a footgun for anyone reading the relay code.
cc @jacderida