WireGuard / wgctrl-go

Package wgctrl enables control of WireGuard interfaces on multiple platforms.
https://godoc.org/golang.zx2c4.com/wireguard/wgctrl
MIT License
753 stars 84 forks source link

internal/windows: deadlock in function interfaceHandle() #134

Closed stenya closed 1 year ago

stenya commented 1 year ago

Deadlock (infinite loop) happens when interfaceHandle() is called after the device was closed.

Issue explanation in code:

func issueTest() {
 devName := "your-device-name"

 client, _ := wgctrl.New()
 defer client.Close()

 client.Device(devName) // ok

 // TODO: disable (disconnect) WireGuard connection

 client.Device(devName) // BUG: deadlock in interfaceHandle() method !!!
}

Pull-request with the fix: https://github.com/WireGuard/wgctrl-go/pull/133