File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
2020 "context"
2121 "encoding/base64"
2222 "encoding/binary"
23+ "errors"
2324 "fmt"
2425 "net"
2526 "net/netip"
@@ -1597,6 +1598,13 @@ func (h *wgtun) listener(op wg.PktDir, err error) {
15971598 } else if op == wg .Rcv && timedout (err ) {
15981599 s = TZZ // writes and reads have succeeded in the recent past
15991600 why = "TZZ: read timeout"
1601+ } else if errors .Is (err , net .ErrClosed ) {
1602+ // github.com/WireGuard/wireguard-go/blob/f333402bd9cb/device/receive.go#L112
1603+ // on net.ErrClosed, wg stops recieving routine for all peers; this among
1604+ // other things mean that the wg.Device is effectively down and would not
1605+ // recieve any incoming messages (nor outgoing as those use the same socket)
1606+ s = TNT
1607+ why = "TNT: closed " + string (op )
16001608 } else {
16011609 s = TKO
16021610 why = "TKO: " + err .Error ()
You can’t perform that action at this time.
0 commit comments