Fix: set metadata.AddrType if host is ip string after remove host (#1291)
This commit is contained in:
parent
0976d27cb1
commit
5da1b2a8aa
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