SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

arekm arekm at pld-linux.org
Mon May 17 22:16:18 CEST 2010


Author: arekm
Date: Mon May 17 22:16:18 2010
New Revision: 11473

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Don't rely on ip link UP checking. Always to mii-tool/ethtool test.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network	(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.network	Mon May 17 22:16:18 2010
@@ -605,32 +605,30 @@
 
 	if ! LC_ALL=C ip link show dev $1 2>/dev/null | grep -q UP; then
 		ip link set dev $1 up >/dev/null 2>&1
-		timeout=0
-		while [ $timeout -le 6 ]; do
-			check_ethtool $1
-			e=$?
-			check_iwconfig $1
-			i=$?
-			# trust ethtool and iwconfig
-			if [ $i -eq 1 ] || [ $e -eq 1 ]; then
-				return 1
-			fi
-			# use mii check only if all other check are unsupported
-			# (mii check lies too often)
-			check_mii_tool $1
-			m=$?
-			if [ $m -eq 1 ] && [ $i -eq 2 ] && [ $e -eq 2 ]; then
-				return 1
-			fi
-			usleep 500000
-			timeout=$((timeout+1))
-		done
-		# do not abort dhclient if all the checks are unsupported
-		if [ $m -eq 2 ] && [ $i -eq 2 ] && [ $e -eq 2 ]; then
-			return 2
+	fi
+	timeout=0
+	while [ $timeout -le 6 ]; do
+		check_ethtool $1
+		e=$?
+		check_iwconfig $1
+		i=$?
+		# trust ethtool and iwconfig
+		if [ $i -eq 1 ] || [ $e -eq 1 ]; then
+			return 1
+		fi
+		# use mii check only if all other check are unsupported
+		# (mii check lies too often)
+		check_mii_tool $1
+		m=$?
+		if [ $m -eq 1 ] && [ $i -eq 2 ] && [ $e -eq 2 ]; then
+			return 1
 		fi
-		return 0
+		usleep 500000
+		timeout=$((timeout+1))
+	done
+	# do not abort dhclient if all the checks are unsupported
+	if [ $m -eq 2 ] && [ $i -eq 2 ] && [ $e -eq 2 ]; then
+		return 2
 	fi
-
-	return 2
+	return 0
 }


More information about the pld-cvs-commit mailing list