mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user