properly handle icmp over tunnel for automatic testing

This commit is contained in:
Owen
2026-08-05 16:16:18 -04:00
parent 202606917c
commit ef1db9a676
4 changed files with 157 additions and 31 deletions
+6 -3
View File
@@ -127,12 +127,15 @@ func (pm *PeerManager) GetPeerMonitor() *monitor.PeerMonitor {
return pm.peerMonitor
}
// SetExitNode starts (or updates) ICMP connectivity monitoring of the given exit node
func (pm *PeerManager) SetExitNode(serverIP string) {
// SetExitNode starts (or updates) ICMP connectivity monitoring of the given exit node.
// tunnelIP is the secondary address assigned to us for this exit node, which the ping
// probe must be sourced from since the exit node's WireGuard peer entry only accepts
// traffic from that address.
func (pm *PeerManager) SetExitNode(serverIP, tunnelIP string) {
pm.mu.RLock()
defer pm.mu.RUnlock()
if pm.peerMonitor != nil {
pm.peerMonitor.SetExitNode(serverIP)
pm.peerMonitor.SetExitNode(serverIP, tunnelIP)
}
}