diff --git a/sess.go b/sess.go index ba049b1..8f163fb 100644 --- a/sess.go +++ b/sess.go @@ -104,8 +104,9 @@ type ( nonce Entropy // packets waiting to be sent on wire - txqueue []ipv4.Message - xconn batchConn // for x/net + txqueue []ipv4.Message + xconn batchConn // for x/net + xconnWriteError error mu sync.Mutex } diff --git a/tx_linux.go b/tx_linux.go index e609aac..b61d77c 100644 --- a/tx_linux.go +++ b/tx_linux.go @@ -13,7 +13,7 @@ import ( func (s *UDPSession) tx(txqueue []ipv4.Message) { // default version - if s.xconn == nil { + if s.xconn == nil || s.xconnWriteError != nil { s.defaultTx(txqueue) return } @@ -36,7 +36,7 @@ func (s *UDPSession) tx(txqueue []ipv4.Message) { if operr, ok := err.(*net.OpError); ok { if se, ok := operr.Err.(*os.SyscallError); ok { if se.Syscall == "sendmmsg" { - s.xconn = nil // set s.xconn to nil permanently + s.xconnWriteError = se s.defaultTx(txqueue) return }