Skip to content

Commit f66f082

Browse files
sanityclaude
andauthored
fix: implement bidirectional UDP hole punching for NAT traversal (#2211)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent b9bb43f commit f66f082

File tree

4 files changed

+349
-106
lines changed

4 files changed

+349
-106
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,18 @@ jobs:
165165
# Use Docker NAT to simulate realistic network topology where peers
166166
# are behind NAT and gateways are on the public network. This provides
167167
# better test coverage for NAT traversal and gateway connection code paths.
168-
# See issue #2204 for context. Only enable if Docker is accessible.
168+
# See issue #2204 for context.
169+
# IMPORTANT: This test MUST run with Docker NAT. If Docker is unavailable,
170+
# the test fails rather than silently falling back to local mode, which
171+
# would skip NAT hole punching validation entirely.
169172
run: |
170-
if docker info >/dev/null 2>&1; then
171-
echo "Docker available - using Docker NAT backend"
172-
export FREENET_TEST_DOCKER_NAT=1
173-
else
174-
echo "Docker not available - using local backend"
173+
if ! docker info >/dev/null 2>&1; then
174+
echo "ERROR: Docker is not available but is REQUIRED for NAT hole punching tests"
175+
echo "A test that doesn't test what it claims to test is worse than no test"
176+
exit 1
175177
fi
178+
echo "Docker available - using Docker NAT backend"
179+
export FREENET_TEST_DOCKER_NAT=1
176180
cargo test --test message_flow river_message_flow_over_freenet_six_peers_five_rounds -- --ignored --exact
177181
178182
ubertest:

0 commit comments

Comments
 (0)