IsIpInRange() returns incorrect false values

Description

IsIpInRange( range, ip ) can take a range in the form of "10.0.0.1-10.0.0.255".

If the end address is on a higher Class C network than the start address, and the last octet of the start or end address is greater than 1 or less than 255, then the function may return incorrect decisions. For example:

1 2 expect( IsIpInRange( "10.0.0.5-10.0.1.10", "10.0.1.1" ) ).toBeTrue(); // returns false expect( IsIpInRange( "10.0.0.5-10.0.1.10", "10.0.0.11" ) ).toBeTrue(); // returns false

It seems that the function is only looking at the final octet on the assumption that the Class C network (i.e. the first 3 octets) is the same.

Environment

None

Status

Assignee

Michael Offner

Reporter

Julian Halliwell

Labels

None

Sprint

None

Fix versions

Affects versions

5.2.9.31

Priority

New
Configure