diff --git a/tunnel/tunnel.go b/tunnel/tunnel.go index 41fb0b16..316e3f4c 100644 --- a/tunnel/tunnel.go +++ b/tunnel/tunnel.go @@ -122,6 +122,11 @@ func preHandleMetadata(metadata *C.Metadata) error { if ip := net.ParseIP(metadata.Host); ip != nil { metadata.DstIP = ip metadata.Host = "" + if ip.To4() != nil { + metadata.AddrType = C.AtypIPv4 + } else { + metadata.AddrType = C.AtypIPv6 + } } // preprocess enhanced-mode metadata