jsakamoto / ipaddressrange

.NET Class Library for range of IP address, both IPv4 and IPv6.
Mozilla Public License 2.0
370 stars 71 forks source link

Public setter property Begin and End dose not change private member "IRangeOperator Operator" #68

Closed sudoudaisuke closed 3 years ago

sudoudaisuke commented 3 years ago

Public setter property Begin and End dose not change private member "IRangeOperator Operator". The sample code is this.

var ipAddressRange1 = IPAddress(IPAdress.Parse(10.10.0.0), IPAdress.Parse(10.10.255.255));
var result1 = ipAddressRange1.Contains(IPAdress.Parse("10.10.0.1")); // I think this result is true, IPAddressRange 4.1.2 returns true

var ipAddressRange2 = IPAddress { Begin = IPAdress.Parse(10.10.0.0), End = IPAdress.Parse(10.10.255.255) };
var result2 = ipAddressRange2.Contains(IPAdress.Parse("10.10.0.1")); // I think this result is true, but IPAddressRange 4.1.2 returns false
jsakamoto commented 3 years ago

@sudoudaisuke Thank you for reporting! Oh, what a terrible bug...

I fixed it and published the new version of this library.

Again, thank you for your contributions. 👍