fix calc ip when add peer wg

This commit is contained in:
mercury
2023-06-11 16:35:55 +04:00
parent 908b5679d0
commit 38a44317af
+1 -1
View File
@@ -2819,7 +2819,7 @@ DNS-over-HTTPS with IP:
$bitmask = $ipnet[1];
if (!empty($conf['peers'])) {
foreach ($conf['peers'] as $k => $v) {
$ips[] = ip2long(explode('/', $v['AllowedIPs'])[0]);
$ips[] = ip2long(explode('/', $v['AllowedIPs'] ?: $v['# AllowedIPs'])[0]);
}
}
$ip_count = (1 << (32 - $bitmask)) - count($ips) - 1;