summaryrefslogtreecommitdiffstats
path: root/etc/rc.initial.setlanip
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-03-14 14:08:38 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-03-14 14:08:38 -0300
commitd632dd5aa9f4809e187475c367f3f1eaf444d8c3 (patch)
tree43413f14a4bb3050a7ec137385ebaaeead487877 /etc/rc.initial.setlanip
parent08e9c732d05b38c9cdcd826ac6a22ff99c155993 (diff)
downloadpfsense-d632dd5aa9f4809e187475c367f3f1eaf444d8c3.zip
pfsense-d632dd5aa9f4809e187475c367f3f1eaf444d8c3.tar.gz
Check if IP is already configured on console setup
Diffstat (limited to 'etc/rc.initial.setlanip')
-rwxr-xr-xetc/rc.initial.setlanip7
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/rc.initial.setlanip b/etc/rc.initial.setlanip
index 5b60132..14213b5 100755
--- a/etc/rc.initial.setlanip
+++ b/etc/rc.initial.setlanip
@@ -258,7 +258,12 @@ function console_configure_ip_address($version) {
$upperifname, $label_IPvX) . "\n> ";
$intip = chop(fgets($fp));
$is_ipaddr = ($version === 6) ? is_ipaddrv6($intip) : is_ipaddrv4($intip);
- } while (!($is_ipaddr || $intip == ''));
+ if ($is_ipaddr && is_ipaddr_configured($intip, $interface, true)) {
+ $ip_conflict = true;
+ echo gettext("This IP address conflicts with another interface or a VIP") . "\n";
+ } else
+ $ip_conflict = false;
+ } while (($ip_conflict === true) || !($is_ipaddr || $intip == ''));
if ($intip != '') {
echo "\n" . sprintf(gettext("Subnet masks are entered as bit counts (as in CIDR notation) in %s."),
$g['product_name']) . "\n";
OpenPOWER on IntegriCloud