mirror of
https://github.com/fosrl/olm.git
synced 2026-03-08 23:03:12 -05:00
[PR #17] [MERGED] Fix UDP port conflict during NAT holepunching on macOS #31
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/olm/pull/17
Author: @danohn
Created: 8/29/2025
Status: ✅ Merged
Merged: 8/30/2025
Merged by: @oschwartz10612
Base:
dev← Head:main📝 Commits (2)
0765b4dUpdate wait timer to 200ms07d5ebdUpdate wait time to 500ms📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
main.go(+2 -1)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Fixes #16 - UDP port conflict during NAT holepunching on macOS
This PR resolves a race condition where the holepunch goroutine was still holding a UDP port when WireGuard attempted to bind to it, causing "address already in use" errors and forcing unnecessary fallbacks to relay mode.
The fix increases the delay after
close(stopHolepunch)from 10ms to 500ms inmain.go, giving macOS sufficient time to release the UDP port before WireGuard initialization.How to test?
Run olm with holepunch enabled on macOS:
Check the logs - you should see successful connection without port errors:
Verify direct connection (not relay) with:
The endpoint should show the peer's actual IP (e.g.,
1.2.3.4:65456) not the relay server IP.Without this fix, you would see:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.