fix: add VPN wake rebind hook (#26739)

Add a CoderVPN WakeRequest RPC so Coder Desktop can trigger the
existing link-change recovery path (Rebind + ReSTUN) immediately on
OS wake, instead of waiting for magicsock's idle re-STUN timer. Wake
events are debounced to at most one rebind per 5s to avoid duplicate
resets of peer path trust.

Closes #26736
This commit is contained in:
Ehab Younes
2026-07-13 15:14:00 +03:00
committed by GitHub
parent 1497ba14fe
commit e11147ec66
8 changed files with 659 additions and 368 deletions
+6
View File
@@ -495,6 +495,12 @@ func (c *Conn) MagicsockSetDebugLoggingEnabled(enabled bool) {
c.magicConn.SetDebugLoggingEnabled(enabled)
}
// Rebind resets local network bindings and rediscovers peer paths.
func (c *Conn) Rebind() {
c.magicConn.Rebind()
c.magicConn.ReSTUN("wake")
}
func (c *Conn) SetAddresses(ips []netip.Prefix) error {
c.configMaps.setAddresses(ips)
c.nodeUpdater.setAddresses(ips)