SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown

arekm arekm at pld-linux.org
Thu Jan 22 09:56:24 CET 2009


Author: arekm
Date: Thu Jan 22 09:56:24 2009
New Revision: 10087

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
Log:
No need for special handling for vlans when downing master device.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown	(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown	Thu Jan 22 09:56:24 2009
@@ -107,51 +107,30 @@
 # Check to make sure the device is actually up
 check_device_down && exit 0
 
-vlan_setup
-if is_yes $ETH_VLANS && $(echo $DEVICE | grep -q ^eth) ; then
-	if echo "${DEVICE}" | grep -q '\.' ; then
-		# vlan down
-		ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
-		ip link set ${DEVICE} down
-		ip link del ${DEVICE} 2>&1 > /dev/null
-	else
-		# downujemy interfejs nadrzedny do vlanow
-		for VLANDEVICE in $(ls /proc/net/vlan 2> /dev/null | grep ^${DEVICE}) ; do
-			# najpierw wszystkie vlany po kolei
-			ip addr flush dev ${VLANDEVICE} 2>&1 | grep -v "Nothing to flush"
-			ip link set ${VLANDEVICE} down
-			ip link del ${VLANDEVICE} 2>&1 > /dev/null
-		done
-		# a potem dopiero interfejs nadrzedny
-		ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
-		ip link set ${DEVICE} down
-	fi
+if [ -n "${SUBDEVICE}" ]; then
+	ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
 else
-	if [ -n "${SUBDEVICE}" ]; then
-		ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
-	else
-		ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
-
-		if [ ${DEVICETYPE} = "bond" ]; then
-			if [ ! -x /sbin/ifenslave ]; then
-				nls "%s is missing. Can't continue." "/sbin/ifenslave"
-				exit 1
-			fi
+	ip addr flush dev ${DEVICE} 2>&1 | grep -v "Nothing to flush"
 
-			# get up the bonding device before enslaving
-			if ! check_device_down "${DEVICE}"; then
-				ip link set ${DEVICE} up
-			fi
+	if [ ${DEVICETYPE} = "bond" ]; then
+		if [ ! -x /sbin/ifenslave ]; then
+			nls "%s is missing. Can't continue." "/sbin/ifenslave"
+			exit 1
+		fi
 
-			for BSVAR in $(awk '/Slave Interface:/{ print $3}' /proc/net/bonding/${DEVICE}); do
-				if [ "${BSVAR}" ]; then
-					ifenslave -d ${DEVICE} $BSVAR
-				fi
-			done
+		# get up the bonding device before enslaving
+		if ! check_device_down "${DEVICE}"; then
+			ip link set ${DEVICE} up
 		fi
 
-		ip link set ${DEVICE} down
+		for BSVAR in $(awk '/Slave Interface:/{ print $3}' /proc/net/bonding/${DEVICE}); do
+			if [ "${BSVAR}" ]; then
+				ifenslave -d ${DEVICE} $BSVAR
+			fi
+		done
 	fi
+
+	ip link set ${DEVICE} down
 fi
 
 if [ "$HANDLING" = "4" ]; then


More information about the pld-cvs-commit mailing list