mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
fix errors ipam pandora_enterprise#9282
This commit is contained in:
parent
56196b12c7
commit
38c7bcc061
@ -5996,6 +5996,26 @@ function send_test_email(
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check ip is valid into network
|
||||
*
|
||||
* @param string $ip Ip XXX.XXX.XXX.XXX.
|
||||
* @param string $cidr Network XXX.XXX.XXX.XXX/XX.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function cidr_match($ip, $cidr)
|
||||
{
|
||||
list($subnet, $mask) = explode('/', $cidr);
|
||||
|
||||
if ((ip2long($ip) & ~((1 << (32 - $mask)) - 1) ) == ip2long($subnet)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Microtime float number.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user