summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2010-11-19 19:33:14 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2010-11-19 19:33:14 +0000
commit600fc8653d180d802da3eaa398f2c5212f415063 (patch)
treeebdae19324560999146fbf0c89213987a09c6d03
parent72c198ecbd6d80130fa45ce3db82d546029dcac9 (diff)
- drop dhcp group from interfaces which did not go UP and got
an ip address - do the same on startup of the install/upgrade too - do NOT do it unconditionally on all dhcp'd interfaces, since we use the group to retain state. ok krw@, deraadt@
-rw-r--r--distrib/miniroot/install.sub13
1 files changed, 10 insertions, 3 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index ad366ad210b..86f3c2ff07c 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.629 2010/11/18 23:25:46 deraadt Exp $
+# $OpenBSD: install.sub,v 1.630 2010/11/19 19:33:13 halex 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
@@ -134,7 +134,7 @@ get_cddevs () {
}
get_ifdevs() {
- ifconfig \
+ ifconfig "$@" 2>&- \
| egrep -v '^[[:space:]]|(bridge|enc|gif|gre|lo|pflog|pfsync|ppp|sl|tun)[[:digit:]]+:' \
| sed -ne 's/^\(.*\):.*/\1/p'
}
@@ -732,7 +732,7 @@ __EOT
return 0
fi
- ifconfig $_ifs delete down
+ ifconfig $_ifs delete down -group dhcp 2>&-
rm /etc/dhclient.conf /etc/resolv.conf.tail
return 1
}
@@ -2039,6 +2039,13 @@ export EDITOR COLUMNS
cd /
umount -af 1>/dev/null 2>&1
+# make sure only successful dhcp requests retain their state
+for _ifs in $(get_ifdevs dhcp); do
+ set -- $(v4_info $_ifs)
+ [[ $1 == UP && -n $2 ]] && continue
+ ifconfig $_ifs delete down -group dhcp 2>&-
+done
+
cat <<__EOT
At any prompt except password prompts you can escape to a shell by
typing '!'. Default answers are shown in []'s and are selected by