Fix error usages

This commit is contained in:
世界 2025-06-20 12:47:19 +08:00
parent bea26198e7
commit 2121bc3f01
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
4 changed files with 10 additions and 6 deletions

View file

@ -4,6 +4,7 @@ package tun
import (
"context"
"errors"
"net"
"os"
"sync"
@ -79,7 +80,7 @@ func (c *gLazyConn) HandshakeFailure(err error) error {
if c.handshakeDone {
return os.ErrInvalid
}
c.request.Complete(err != ErrDrop)
c.request.Complete(!errors.Is(err, ErrDrop))
c.handshakeDone = true
c.handshakeErr = err
return nil