Fix: set metadata.AddrType if host is ip string after remove host (#1291)
This commit is contained in:
parent
0c2e1dc55d
commit
b1d7346175
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue