@@ -3,7 +3,6 @@ package wireguard
33import (
44 "context"
55 "fmt"
6- "net"
76 "net/netip"
87 "runtime"
98 "strconv"
@@ -13,7 +12,7 @@ import (
1312
1413 "github.com/xtls/xray-core/common/errors"
1514 "github.com/xtls/xray-core/common/log"
16- xnet "github.com/xtls/xray-core/common/net"
15+ "github.com/xtls/xray-core/common/net"
1716 "github.com/xtls/xray-core/proxy/wireguard/gvisortun"
1817 "gvisor.dev/gvisor/pkg/tcpip"
1918 "gvisor.dev/gvisor/pkg/tcpip/adapters/gonet"
@@ -28,7 +27,7 @@ import (
2827
2928type tunCreator func (localAddresses []netip.Addr , mtu int , handler promiscuousModeHandler ) (Tunnel , error )
3029
31- type promiscuousModeHandler func (dest xnet .Destination , conn net.Conn )
30+ type promiscuousModeHandler func (dest net .Destination , conn net.Conn )
3231
3332type Tunnel interface {
3433 BuildDevice (ipc string , bind conn.Bind ) error
@@ -169,7 +168,7 @@ func createGVisorTun(localAddresses []netip.Addr, mtu int, handler promiscuousMo
169168 ep .SocketOptions ().SetKeepAlive (true )
170169
171170 // local address is actually destination
172- handler (xnet .TCPDestination (xnet .IPAddress (id .LocalAddress .AsSlice ()), xnet .Port (id .LocalPort )), gonet .NewTCPConn (& wq , ep ))
171+ handler (net .TCPDestination (net .IPAddress (id .LocalAddress .AsSlice ()), net .Port (id .LocalPort )), gonet .NewTCPConn (& wq , ep ))
173172 }(r )
174173 })
175174 stack .SetTransportProtocolHandler (tcp .ProtocolNumber , tcpForwarder .HandlePacket )
@@ -194,7 +193,7 @@ func createGVisorTun(localAddresses []netip.Addr, mtu int, handler promiscuousMo
194193 Timeout : 15 * time .Second ,
195194 })
196195
197- handler (xnet .UDPDestination (xnet .IPAddress (id .LocalAddress .AsSlice ()), xnet .Port (id .LocalPort )), gonet .NewUDPConn (& wq , ep ))
196+ handler (net .UDPDestination (net .IPAddress (id .LocalAddress .AsSlice ()), net .Port (id .LocalPort )), gonet .NewUDPConn (& wq , ep ))
198197 }(r )
199198 })
200199 stack .SetTransportProtocolHandler (udp .ProtocolNumber , udpForwarder .HandlePacket )
0 commit comments