Refactor(metadata): replace net.IP with netip.Addr (#396)

This commit is contained in:
Jason Lyu
2024-09-01 02:57:09 +08:00
committed by GitHub
parent 1f09b4d42d
commit bd37a1a4c6
6 changed files with 57 additions and 44 deletions

View File

@@ -243,7 +243,7 @@ func serializeRelayAddr(m *M.Metadata) *relay.AddrFeature {
Host: m.DstIP.String(),
Port: m.DstPort,
}
if m.DstIP.To4() != nil {
if m.DstIP.Is4() {
af.AType = relay.AddrIPv4
} else {
af.AType = relay.AddrIPv6