Compare commits

...
2 Commits
Author SHA1 Message Date
RPRXandGitHub cc190f2d8e Update handler.go 2026-06-23 10:56:07 +00:00
Fangliding 455197dd91 Fix TUN nil addr 2026-06-23 18:46:05 +08:00
+8 -1
View File
@@ -143,7 +143,14 @@ func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination) {
defer cancel()
ctx = c.ContextWithID(ctx, session.NewID())
source := net.DestinationFromAddr(conn.RemoteAddr())
// if the connection is already closed, conn.RemoteAddr() will be nil
// due to gvisor weird behavior
remote := conn.RemoteAddr()
if remote == nil {
errors.LogInfo(t.ctx, "dropped quickly closed connection")
return
}
source := net.DestinationFromAddr(remote)
inbound := session.Inbound{
Name: "tun",
Tag: t.tag,