From fe992d62dbc4b5606c681038c28400725e4a5345 Mon Sep 17 00:00:00 2001 From: ambrisko Date: Sun, 25 Jan 2004 19:52:16 +0000 Subject: - Existing code would ignore pccard_ether_delay when more then 9 seconds - If there was an exiting dhclient running on the same interface as the new iface that left and returned then dhclient would be told to use the same interface twice. Dhclient would fail and exit after getting confused. Use "sort -u" on them to ensure no duplicates. This is a mostly a race condition on suspend and resume and how things happen to occur. - Check for netmask being set on an interface rather then up. An interface can be up but not configured. Reviewed by: mbr --- etc/pccard_ether | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'etc/pccard_ether') diff --git a/etc/pccard_ether b/etc/pccard_ether index 6f16ef0..90f1164 100755 --- a/etc/pccard_ether +++ b/etc/pccard_ether @@ -85,14 +85,15 @@ start_dhcp() { case ${pccard_ether_delay} in [Nn][Oo]) ;; - [0-9]) + [0-9]*) sleep ${pccard_ether_delay} ;; esac [ -n "$dhcp_program" ] && dhclient_program="$dhcp_program" [ -n "$dhcp_flags" ] && dhclient_flags="$dhcp_flags" if [ -x "${dhclient_program}" ]; then - ${dhclient_program} ${dhclient_flags} $_dhcplist ${interface} + interfaces=`echo $_dhcplist ${interface} | xargs -n 1 echo | sort -u ` + ${dhclient_program} ${dhclient_flags} ${interfaces} else echo "${dhclient_program}: DHCP client software not available" fi @@ -138,7 +139,7 @@ esac case ${startstop} in [Ss][Tt][Aa][Rr][Tt] | '') if [ -x /usr/bin/grep ]; then - if ifconfig ${interface} | grep -s UP, > /dev/null 2>&1; then + if ifconfig ${interface} | grep -s netmask > /dev/null 2>&1; then # Interface is already up, so ignore it. exit 0 fi -- cgit v1.1