diff --git a/src/ipv4.rs b/src/ipv4.rs index d9b1db2..06726ff 100644 --- a/src/ipv4.rs +++ b/src/ipv4.rs @@ -80,7 +80,7 @@ impl Ipv4Network { /// Checks if the given `Ipv4Network` is a subnet of the other. pub fn is_subnet_of(self, other: Ipv4Network) -> bool { - other.ip() <= self.ip() && other.broadcast() >= self.broadcast() + other.network() <= self.network() && other.broadcast() >= self.broadcast() } /// Checks if the given `Ipv4Network` is a supernet of the other. diff --git a/src/ipv6.rs b/src/ipv6.rs index 129edab..f3a21e7 100644 --- a/src/ipv6.rs +++ b/src/ipv6.rs @@ -122,7 +122,7 @@ impl Ipv6Network { /// Checks if the given `Ipv6Network` is a subnet of the other. pub fn is_subnet_of(self, other: Ipv6Network) -> bool { - other.ip() <= self.ip() && other.broadcast() >= self.broadcast() + other.network() <= self.network() && other.broadcast() >= self.broadcast() } /// Checks if the given `Ipv6Network` is a supernet of the other.