o Don't do anything if the interface is already up.

o Only delay in pccard_ether when we're doing dhcp and starting the interface.

Approved: (re blanket for devd)
This commit is contained in:
Warner Losh 2002-12-11 23:30:34 +00:00
parent 549bfb9273
commit 39a61a1fda
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107761
2 changed files with 17 additions and 11 deletions

View file

@ -21,6 +21,13 @@ stop_dhcp() {
start_dhcp() {
stop_dhcp
case ${pccard_ether_delay} in
[Nn][Oo])
;;
[0-9])
sleep ${pccard_ether_delay}
;;
esac
if [ -x "${dhcp_program}" ]; then
if [ `basename ${dhcp_program}` = "dhclient" ]; then
pidfile="/var/run/dhclient.${interface}.pid"
@ -46,17 +53,6 @@ shift
startstop=$1
shift
case ${pccard_ether_delay} in
[Nn][Oo])
;;
[0-9])
sleep ${pccard_ether_delay}
;;
*) # Default until it has had a chance to make it to /etc/defaults/rc.conf
sleep 5
;;
esac
case ${pccard_ifconfig} in
[Nn][Oo] | '')
expr "${removable_interfaces}" : ".*${interface}" > /dev/null || exit 0
@ -69,6 +65,11 @@ esac
case ${startstop} in
[Ss][Tt][Aa][Rr][Tt] | '')
if ifconfig ${interface} | grep -s UP,; then
# Interface is already up, so ignore it.
exit 0
fi
if [ -r /etc/start_if.${interface} ]; then
. /etc/start_if.${interface}
fi

View file

@ -209,6 +209,11 @@ network_pass1() {
dhcp_interfaces=""
for ifn in ${network_interfaces}; do
if ifconfig ${interface} | grep -s UP,; then
# Interface is already up, so ignore it.
continue;
fi
if [ -r /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
eval showstat_$ifn=1