Fix client count bug when ipv4 subnet is /24

This commit is contained in:
Stephen Seo 2024-02-17 15:32:14 +09:00
parent e682a003ff
commit 56cbde1a2f

View file

@ -117,7 +117,7 @@ fi
if (( $WG_SUBNET < 24 )); then if (( $WG_SUBNET < 24 )); then
echo "ERROR: subnet cannot be less than 24!" echo "ERROR: subnet cannot be less than 24!"
exit 9 exit 9
elif (( $WG_SUBNET > 24 )); then elif (( $WG_SUBNET >= 24 )); then
USED_BITS=$(( 32 - $WG_SUBNET )) USED_BITS=$(( 32 - $WG_SUBNET ))
if (( $USED_BITS < 2 )); then if (( $USED_BITS < 2 )); then
echo "ERROR: subnet \"$WG_SUBNET\" is too large! Use 24-30!" echo "ERROR: subnet \"$WG_SUBNET\" is too large! Use 24-30!"