summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-06-12 03:25:25 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-06-12 03:25:25 +0000
commit0ab2f30eef557c5f63a64794fb3c4f6c62cae595 (patch)
treef194549ec9ce185564d24fe046de8faa61c54810 /distrib
parentd1f0b63dafa743147b4e652f5c5cb2f2e0c5dd9c (diff)
Avoid vlan explosion reported by deraadt@, sthen@ and jsing@ when
^C'ing and restarting the install script. When looking for the next vlan to offer, stop at the first unconfigured one rather than the first non-existant one. ok deraadt@
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sub8
1 files changed, 6 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index dd2486e992f..ba81cf98e20 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.584 2009/06/11 04:21:27 deraadt Exp $
+# $OpenBSD: install.sub,v 1.585 2009/06/12 03:25:24 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -563,9 +563,13 @@ configure_ifs() {
local _first _ifdevs _ifs _name _hn _vl=0 _vd _vi _p _tags
# In case of restart, discover last vlan configured.
- while ifconfig vlan$_vl >/dev/null 2>&1; do
+ while :; do
+ _vd=$(ifconfig vlan$_vl 2>&1)
+ [[ $_vd == @(*no such interface*) ]] && break
+ [[ $_vd == @(vlan$_vl: flags=0<>*) ]] && break
: $(( _vl++ ))
done
+ _vd=
while :; do
# Create new vlan if possible.