small changes

This commit is contained in:
yusing 2024-11-30 01:06:06 +08:00
parent 10591452e4
commit 4188bbc5bd
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,7 @@
package types package types
import ( import (
"bytes"
"net" "net"
"strings" "strings"
@ -40,5 +41,5 @@ func (cidr *CIDR) String() string {
} }
func (cidr *CIDR) Equals(other *CIDR) bool { func (cidr *CIDR) Equals(other *CIDR) bool {
return (*net.IPNet)(cidr).IP.Equal(other.IP) && cidr.Mask.String() == other.Mask.String() return (*net.IPNet)(cidr).IP.Equal(other.IP) && bytes.Equal(cidr.Mask, other.Mask)
} }