Skip to content

Commit

Permalink
Fix PrefixFromNet
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed May 29, 2024
1 parent 29a135a commit 4903b51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/metadata/addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func PrefixFromNet(netAddr net.Addr) netip.Prefix {
switch addr := netAddr.(type) {
case *net.IPNet:
bits, _ := addr.Mask.Size()
return netip.PrefixFrom(AddrFromIP(addr.IP), bits)
return netip.PrefixFrom(AddrFromIP(addr.IP).Unmap(), bits)
default:
return netip.Prefix{}
}
Expand Down

0 comments on commit 4903b51

Please sign in to comment.