summaryrefslogtreecommitdiffstats
path: root/etc/rc.initial.setlanip
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-12-12 21:04:46 +0545
committerRenato Botelho <garga@FreeBSD.org>2014-12-12 14:49:43 -0200
commita7d7cd7fa584268cafad776daa52cef5434e81a5 (patch)
tree7434d2861525b7f52750ace84f8c2134163db265 /etc/rc.initial.setlanip
parent245f78d2a5615df41dd657a075508211d5e5c408 (diff)
downloadpfsense-a7d7cd7fa584268cafad776daa52cef5434e81a5.zip
pfsense-a7d7cd7fa584268cafad776daa52cef5434e81a5.tar.gz
rc.initial.setlanip fix validation of CIDR within range
Currently this allows the user to input any number for the CIDR. I happened to try 44 for an IPv4 CIDR when playing. This fixes that little bug - I think it is good to commit that first/separately so it can be identified apart from the other (y/n) checking/handling I am working on. Better to have separate commits for distinct bugs.
Diffstat (limited to 'etc/rc.initial.setlanip')
-rwxr-xr-xetc/rc.initial.setlanip2
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/rc.initial.setlanip b/etc/rc.initial.setlanip
index f49cac2..430270d 100755
--- a/etc/rc.initial.setlanip
+++ b/etc/rc.initial.setlanip
@@ -284,7 +284,7 @@ function console_configure_ip_address($version) {
echo "\n" . sprintf(gettext("Enter the new %s %s subnet bit count:"),
$upperifname, $label_IPvX) . "\n> ";
$intbits = chop(fgets($fp));
- $intbits_ok = is_numeric($intbits) && (($intbits >= 1) || ($intbits <= $maxbits));
+ $intbits_ok = is_numeric($intbits) && (($intbits >= 1) && ($intbits <= $maxbits));
$restart_dhcpd = true;
if ($version === 4 && $intbits < $maxbits) {
OpenPOWER on IntegriCloud