tunnel: document TAP goroutine lifecycle on disconnect

The TAP→Server goroutine can't be interrupted (TAP fd doesn't support
deadlines). It exits on next TAP frame when WriteFrames fails on the
closed connection. Document this rather than add complexity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Git Sagar 2026-06-06 17:29:47 +05:30
parent b2ef8bc1bf
commit bbeeb8c41b

View file

@ -134,6 +134,9 @@ func (t *Tunnel) Bridge(tapRead func(buf []byte) (int, error), tapWrite func(buf
}()
// TAP → Server
// Note: tapRead blocks on the TAP fd which doesn't support deadlines.
// On disconnect, this goroutine survives until the next TAP frame arrives,
// at which point WriteFrames fails on the closed connection and it exits.
go func() {
buf := make([]byte, 1600)
for {