Skip to content

Commit 4d05807

Browse files
committed
ipn/wg: ignore always nil errs on close
1 parent 8ecd91d commit 4d05807

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

intra/ipn/wgproxy.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,12 +1590,15 @@ func (h *wgtun) serve(network, local string) (pc net.PacketConn, err error) {
15901590
func (h *wgtun) listener(op wg.PktDir, err error) {
15911591
s := h.status.Load()
15921592
cur := s
1593-
if op.Read() {
1594-
h.latestRxErr.Store(err)
1595-
} else if op.Write() {
1596-
h.latestTxErr.Store(err)
1597-
} else {
1598-
h.latestErr.Store(err)
1593+
1594+
if op != wg.Clo {
1595+
if op.Read() {
1596+
h.latestRxErr.Store(err)
1597+
} else if op.Write() {
1598+
h.latestTxErr.Store(err)
1599+
} else {
1600+
h.latestErr.Store(err)
1601+
}
15991602
}
16001603

16011604
if s == END || s == TPU { // stopped or paused

0 commit comments

Comments
 (0)