mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-24 05:02:14 +08:00
Fix: set metadata.AddrType if host is ip string after remove host (#1291)
This commit is contained in:
parent
0976d27cb1
commit
5da1b2a8aa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user