Fix error usages

This commit is contained in:
世界
2025-06-20 12:47:19 +08:00
parent bea26198e7
commit 2121bc3f01
4 changed files with 10 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ package tun
import (
"context"
"errors"
"math"
"net/netip"
"os"
@@ -59,7 +60,7 @@ func rangeIterate(r stack.Range, fn func(*buffer.View))
func (f *UDPForwarder) PreparePacketConnection(source M.Socksaddr, destination M.Socksaddr, userData any) (bool, context.Context, N.PacketWriter, N.CloseHandlerFunc) {
pErr := f.handler.PrepareConnection(N.NetworkUDP, source, destination)
if pErr != nil {
if pErr != ErrDrop {
if !errors.Is(pErr, ErrDrop) {
gWriteUnreachable(f.stack, userData.(*stack.PacketBuffer))
}
return false, nil, nil, nil