mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-07 04:08:44 +00:00
Fix TUN nil addr
This commit is contained in:
@@ -143,7 +143,14 @@ func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination) {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
ctx = c.ContextWithID(ctx, session.NewID())
|
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 quick close connection")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
source := net.DestinationFromAddr(remote)
|
||||||
inbound := session.Inbound{
|
inbound := session.Inbound{
|
||||||
Name: "tun",
|
Name: "tun",
|
||||||
Tag: t.tag,
|
Tag: t.tag,
|
||||||
|
|||||||
Reference in New Issue
Block a user