Refactor: metadata use netip.Addr

This commit is contained in:
yaling888
2022-04-20 01:52:51 +08:00
committed by adlyq
parent 6c4791480e
commit 7ca1a03d73
45 changed files with 374 additions and 346 deletions

View File

@ -37,7 +37,7 @@ func NewInner(conn net.Conn, dst string, host string) *context.ConnContext {
metadata.DstPort = port
if host == "" {
metadata.DstIP = ip
if ip.To4() == nil {
if ip.Is4() {
metadata.AddrType = C.AtypIPv6
} else {
metadata.AddrType = C.AtypIPv4