diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-05-09 16:59:26 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2019-05-09 16:59:26 +0000 |
commit | e56d69b18667866282363cb635c2cbddd927bc36 (patch) | |
tree | 8603fb52a4790ded0dbf3dc2550b401a332423c8 /distrib/miniroot/install.sub | |
parent | 85010783c2cdfe90ae359de3f0e181aeec89ec17 (diff) |
Shuffle code a bit to consistently call 'ifconfig $_if [-inet|-inet6]' to
completely clear existing configurations after restarting an install.
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r-- | distrib/miniroot/install.sub | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 1f111d64fab..8cf7eee7b8e 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1123 2019/05/09 06:00:55 krw Exp $ +# $OpenBSD: install.sub,v 1.1124 2019/05/09 16:59:25 krw Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org> @@ -1026,6 +1026,10 @@ v4_config() { fi _prompt="IPv4 address for $_if? (${_prompt}or 'none')" + # Nuke existing inet configuration. + ifconfig $_if -inet + ifconfig $_if -group dhcp >/dev/null 2>&1 + while :; do ask_until "$_prompt" "$_addr" case $resp in @@ -1041,7 +1045,6 @@ v4_config() { fi ;; *) _addr=$resp - ifconfig $_if -group dhcp >/dev/null 2>&1 ;; esac @@ -1129,21 +1132,20 @@ v6_config() { _prompt="IPv6 address for $_if? (or 'autoconf' or 'none')" + # Nuke existing inet6 configuration. + ifconfig $_if -inet6 + while :; do ask_until "$_prompt" "${_addr:-none}" case $resp in - none) ifconfig $_if -inet6 - return + none) return ;; autoconf) - # Nuke any existing address before enabling autoconf. - ifconfig $_if -inet6 ifconfig $_if inet6 autoconf up echo "inet6 autoconf" >>$_hn return ;; - *) ifconfig $_if inet6 -autoconf - _addr=${resp%%/*} + *) _addr=${resp%%/*} if [[ $resp == */* ]]; then _prefixlen=${resp##$_addr/} else |