From 2678489d32c6b84a940b4bcd2bf68583767acc5e Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 16 Jan 2023 12:47:22 +0800 Subject: [PATCH] fix: addr panic --- go.mod | 2 +- go.sum | 4 ++-- listener/sing/sing.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index a0f95e20..199f3e9c 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/miekg/dns v1.1.50 github.com/oschwald/geoip2-golang v1.8.0 github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 - github.com/sagernet/sing v0.1.5 + github.com/sagernet/sing v0.1.6-0.20230114115804-bc788b027182 github.com/sagernet/sing-vmess v0.1.1 github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c github.com/samber/lo v1.35.0 diff --git a/go.sum b/go.sum index 262b98c1..176d7f95 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,8 @@ github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61/go.mod h github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 h1:iL5gZI3uFp0X6EslacyapiRz7LLSJyr4RajF/BhMVyE= github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM= github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY= -github.com/sagernet/sing v0.1.5 h1:1ZHE4cqqds8559RPqzmHiXkOYWyXkNDiULFr00+LxG8= -github.com/sagernet/sing v0.1.5/go.mod h1:JLSXsPTGRJFo/3X7EcAOCUgJH2/gAoxSJgBsnCZRp/w= +github.com/sagernet/sing v0.1.6-0.20230114115804-bc788b027182 h1:TsLXlVXH7ql2yHOYczF6hfHrrAiMiS6itVG0HMJKJ08= +github.com/sagernet/sing v0.1.6-0.20230114115804-bc788b027182/go.mod h1:JLSXsPTGRJFo/3X7EcAOCUgJH2/gAoxSJgBsnCZRp/w= github.com/sagernet/sing-vmess v0.1.1 h1:WMdkJcc3icIqpDQZGQ7X+jfLilooIZ0zAaC0qeQTWFU= github.com/sagernet/sing-vmess v0.1.1/go.mod h1:COSSEmy19vMWOTEKIUSDiTEyx6yBfTYIzekDlCMow+Q= github.com/sagernet/wireguard-go v0.0.0-20221116151939-c99467f53f2c h1:vK2wyt9aWYHHvNLWniwijBu/n4pySypiKRhN32u/JGo= diff --git a/listener/sing/sing.go b/listener/sing/sing.go index e8aafa39..2780e275 100644 --- a/listener/sing/sing.go +++ b/listener/sing/sing.go @@ -146,7 +146,7 @@ func (c *packet) WriteBack(b []byte, addr net.Addr) (n int, err error) { err = errors.New("writeBack to closed connection") return } - err = conn.WritePacket(buff, M.ParseSocksaddr(addr.String())) + err = conn.WritePacket(buff, M.SocksaddrFromNet(addr)) return }