From cc7b5d82805571588ee836be92820fc5037ff81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 19 Jun 2023 13:29:41 +0800 Subject: [PATCH] Unwrap 4in6 address received by client packet conn --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- transport/trojan/protocol.go | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 1cf1ca61..bd77674d 100644 --- a/go.mod +++ b/go.mod @@ -25,14 +25,14 @@ require ( github.com/sagernet/gvisor v0.0.0-20230611140528-4411f7659a08 github.com/sagernet/quic-go v0.0.0-20230615020047-10f05c797c02 github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 - github.com/sagernet/sing v0.2.5 + github.com/sagernet/sing v0.2.6 github.com/sagernet/sing-dns v0.1.5 github.com/sagernet/sing-mux v0.1.0 github.com/sagernet/sing-shadowsocks v0.2.2 - github.com/sagernet/sing-shadowsocks2 v0.1.0 + github.com/sagernet/sing-shadowsocks2 v0.1.1 github.com/sagernet/sing-shadowtls v0.1.2 - github.com/sagernet/sing-tun v0.1.5 - github.com/sagernet/sing-vmess v0.1.5 + github.com/sagernet/sing-tun v0.1.6-0.20230619052205-bb60e4d6d06b + github.com/sagernet/sing-vmess v0.1.6 github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 github.com/sagernet/tfo-go v0.0.0-20230303015439-ffcfd8c41cf9 github.com/sagernet/utls v0.0.0-20230309024959-6732c2ab36f2 diff --git a/go.sum b/go.sum index d262e249..c4e1a41a 100644 --- a/go.sum +++ b/go.sum @@ -116,22 +116,22 @@ github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byL github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU= github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY= github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk= -github.com/sagernet/sing v0.2.5 h1:N8sUluR8GZvR9DqUiH3FA3vBb4m/EDdOVTYUrDzJvmY= -github.com/sagernet/sing v0.2.5/go.mod h1:Ta8nHnDLAwqySzKhGoKk4ZIB+vJ3GTKj7UPrWYvM+4w= +github.com/sagernet/sing v0.2.6 h1:Fvqv7/Bwc72ERT6dE8yQLLY6SMc/syO3VMCtxVO4DNw= +github.com/sagernet/sing v0.2.6/go.mod h1:Ta8nHnDLAwqySzKhGoKk4ZIB+vJ3GTKj7UPrWYvM+4w= github.com/sagernet/sing-dns v0.1.5 h1:0J9G3ye+FUPUjIQXoWVF/RN3Ii4LtepbMmDL4SzEEh0= github.com/sagernet/sing-dns v0.1.5/go.mod h1:4Wr7+I8H+i/fvjPQo5wyylhcM0GbNLiqevXmzOm0bHM= github.com/sagernet/sing-mux v0.1.0 h1:xihlDRNs1J+hYwmvW9/ZmaghjDx7O0Y5dty0pOLQGB4= github.com/sagernet/sing-mux v0.1.0/go.mod h1:i3jKjV4pRTFTV/ly5V3oa2JMPy0SAZ5X8X4tDU9Hw94= github.com/sagernet/sing-shadowsocks v0.2.2 h1:ezSdVhrmIcwDXmCZF3bOJVMuVtTQWpda+1Op+Ie2TA4= github.com/sagernet/sing-shadowsocks v0.2.2/go.mod h1:JIBWG6a7orB2HxBxYElViQFLUQxFVG7DuqIj8gD7uCQ= -github.com/sagernet/sing-shadowsocks2 v0.1.0 h1:yXiAmSGQfYgdtSfpeA5ovc+qISBc865vmNCJPSlK7AM= -github.com/sagernet/sing-shadowsocks2 v0.1.0/go.mod h1:yD/LryoAhW1pYSHXjeITnggEeDwkOM5emmDAjHL6orU= +github.com/sagernet/sing-shadowsocks2 v0.1.1 h1:/cZteeSFXyHKg0uOparIFNj8hHrV8F2rRzTm8arpBTs= +github.com/sagernet/sing-shadowsocks2 v0.1.1/go.mod h1:p18C731ogLED66ZgC1SNYMOXAOxJIRwcTSUk73q/rsc= github.com/sagernet/sing-shadowtls v0.1.2 h1:wkPf4gF+cmaP0cIbArpyq+mc6GcwbMx60CssmmhEQ0s= github.com/sagernet/sing-shadowtls v0.1.2/go.mod h1:rTxhbSY8jGWZOWjdeOe1vP3E+hkgen8aRA2p7YccM88= -github.com/sagernet/sing-tun v0.1.5 h1:sqIutzJBfxFeBfaIWu75AA4q/094CSdzgiGQfrwagW8= -github.com/sagernet/sing-tun v0.1.5/go.mod h1:7nDIrea8A4ekY8cW6wbjM+sWHkzBQ/oFVmChlW/USOc= -github.com/sagernet/sing-vmess v0.1.5 h1:5jECfTV9ma8wjNt/siZElKpKe3AjWmhi7NeLLfLzehY= -github.com/sagernet/sing-vmess v0.1.5/go.mod h1:d+TCQZgba0EM7+bRrp2pYn6wB0Kd3i+wHuD3M6IxvEQ= +github.com/sagernet/sing-tun v0.1.6-0.20230619052205-bb60e4d6d06b h1:q8qr0SARPRoPyQfrAUQ6OKQXcQ0OK6zfC4anQ3eMXK8= +github.com/sagernet/sing-tun v0.1.6-0.20230619052205-bb60e4d6d06b/go.mod h1:7nDIrea8A4ekY8cW6wbjM+sWHkzBQ/oFVmChlW/USOc= +github.com/sagernet/sing-vmess v0.1.6 h1:u9VhPNMP0u1vaEjWRWitJQ4KKYPhTF0rorpAlQZcFBg= +github.com/sagernet/sing-vmess v0.1.6/go.mod h1:XYXpk405G+kxRMNfREhROJsBxh1ccHy1v/fWSV5lx38= github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37 h1:HuE6xSwco/Xed8ajZ+coeYLmioq0Qp1/Z2zczFaV8as= github.com/sagernet/smux v0.0.0-20230312102458-337ec2a5af37/go.mod h1:3skNSftZDJWTGVtVaM2jfbce8qHnmH/AGDRe62iNOg0= github.com/sagernet/tfo-go v0.0.0-20230303015439-ffcfd8c41cf9 h1:2ItpW1nMNkPzmBTxV0/eClCklHrFSQMnUGcpUmJxVeE= diff --git a/transport/trojan/protocol.go b/transport/trojan/protocol.go index 12195f58..c3d649af 100644 --- a/transport/trojan/protocol.go +++ b/transport/trojan/protocol.go @@ -309,7 +309,7 @@ func ReadPacket(conn net.Conn, buffer *buf.Buffer) (M.Socksaddr, error) { } _, err = buffer.ReadFullFrom(conn, int(length)) - return destination, err + return destination.Unwrap(), err } func WritePacket(conn net.Conn, buffer *buf.Buffer, destination M.Socksaddr) error {