Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions util/netutils/ipv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,15 @@ func (addr IPV6Addr) Ge(addr2 IPV6Addr) bool {
return !addr.Lt(addr2)
}

func (addr IPV6Addr) IsZero() bool {
for _, v := range addr {
if v != 0 {
return false
}
}
return true
}

type IPV6AddrRange struct {
start IPV6Addr
end IPV6Addr
Expand Down
4 changes: 4 additions & 0 deletions util/netutils/netutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ func (addr IPV4Addr) ToMac(prefix string) string {
return fmt.Sprintf("%s%02x:%02x:%02x:%02x", prefix, bytes[0], bytes[1], bytes[2], bytes[3])
}

func (addr IPV4Addr) IsZero() bool {
return addr == 0
}

type IPV4AddrRange struct {
start IPV4Addr
end IPV4Addr
Expand Down