mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
openvpn: allow /32, & bitwise operator is before != ???
PR: https://forum.opnsense.org/index.php?topic=9445.0
This commit is contained in:
parent
8287fcf32a
commit
4d664bc39d
@ -419,11 +419,8 @@ function openvpn_validate_cidr_ipv4($value, $allow_hosts = false)
|
||||
return false;
|
||||
}
|
||||
if (!$allow_hosts) {
|
||||
if ($prefix == 32) {
|
||||
return false;
|
||||
}
|
||||
$mask = (0xffffffff << (32 - $prefix)) & 0xffffffff;
|
||||
if (ip2long($ip) & $mask != ip2long($ip)) {
|
||||
if ((ip2long($ip) & $mask) != ip2long($ip)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user