diff options
| author | Simon Rettberg | 2025-11-26 10:45:17 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2025-11-26 10:45:17 +0100 |
| commit | 7dcff81afd58c766406747f67f035e41fb488ba9 (patch) | |
| tree | e772c6c162a12db24637a13220438af2aec5a4df | |
| parent | [roomplanner] Fix snap-to-grid behavior (diff) | |
| download | slx-admin-7dcff81afd58c766406747f67f035e41fb488ba9.tar.gz slx-admin-7dcff81afd58c766406747f67f035e41fb488ba9.tar.xz slx-admin-7dcff81afd58c766406747f67f035e41fb488ba9.zip | |
[inc/IpUtil] Fix bug in CIDR verification
| -rw-r--r-- | inc/iputil.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/inc/iputil.inc.php b/inc/iputil.inc.php index a50f22eb..9ec78f50 100644 --- a/inc/iputil.inc.php +++ b/inc/iputil.inc.php @@ -7,7 +7,7 @@ class IpUtil public static function rangeToCidr(int $start, int $end): string { - $value = $start ^ $end; + $value = $end - $start; if (!self::isAllOnes($value)) return 'NOT SUBNET: ' . long2ip($start) . '-' . long2ip($end); $ones = self::bitLength($value); @@ -16,7 +16,7 @@ class IpUtil public static function isValidSubnetRange(int $start, int $end): bool { - return self::isAllOnes($start ^ $end); + return self::isAllOnes($end - $start); } /** |
