Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Jul 17, 2024
1 parent 51b139a commit e7a1a0b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions model/modelpb/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func Addr2IP(addr netip.Addr) *IP {

// IP2Addr converts a valid IP to netip.Addr.
func IP2Addr(i *IP) netip.Addr {
if i == nil {
return netip.Addr{}
}
if addr := i.GetV6(); len(addr) == 16 {
return netip.AddrFrom16([16]byte(addr))
}
Expand Down

0 comments on commit e7a1a0b

Please sign in to comment.