Hi,
I stumbled upon an "off by one" error in the is_ipaddress function in ping.php from cacti 0.8.7b.
For IPv4 adresses there is a loop:
foreach($octets as $octet) {
if(($octet < 0) || ($octet >= 255)) {
return false;
}
}
Unfortunately there are valid IPv4 addresses around that contain a 255 in one of the octets, e.g. 172.16.2.255 in the net 172.16.0.0/16. This address won't be pingable and thus marked down.
The fix is trivial: check for $octet > 255 and be done .
Obviously this won't keep someone entering a netmask or anything else stupid, but I don't figure that it's possible to check for all stupidity...
I hope this is a valid way to ask for an improvement aka bugfix.
Cheers
Knallfrosch
But in function is_ipaddress in ping.php?
Moderators: Developers, Moderators
-
- Posts: 13
- Joined: Wed Nov 19, 2008 4:08 pm
Who is online
Users browsing this forum: No registered users and 2 guests