diff options
author | 2009-06-12 03:25:24 +0000 | |
---|---|---|
committer | 2009-06-12 03:25:24 +0000 | |
commit | 8974ca482620cbb469c908171f586fc71e70de17 (patch) | |
tree | 7520ac0eb9915b9554a3cecf11438f2bc99d6e24 | |
parent | rewrite the way states from pfsync are merged into the local state tree (diff) | |
download | wireguard-openbsd-8974ca482620cbb469c908171f586fc71e70de17.tar.xz wireguard-openbsd-8974ca482620cbb469c908171f586fc71e70de17.zip |
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@
-rw-r--r-- | distrib/miniroot/install.sub | 8 |
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. |