Here is the diff again, sorry for the empty file.

-- 
Gerard Beekmans

/* If Linux doesn't have the solution, you have the wrong problem */

--- ipv4-static	2005-02-23 07:52:46.000000000 -0700
+++ ipv4-static-vlan	2005-02-28 15:00:12.971983544 -0700
@@ -17,6 +17,13 @@
 . ${rc_functions} 
 . ${IFCONFIG}
 
+if [ -z "${VLAN}" ]
+then
+	boot_mesg "VLAN variable missing from ${IFCONFIG}, cannot continue." ${FAILURE}
+	echo_failure
+	exit 1
+fi
+
 if [ -z "${IP}" ]
 then
 	boot_mesg "IP variable missing from ${IFCONFIG}, cannot continue." ${FAILURE}
@@ -56,6 +63,21 @@
 
 case "${2}" in
 	up)
+		boot_mesg "Adding VLAN ${VLAN} to the ${LINK} interface..."
+		vconfig add ${LINK} ${VLAN}
+		evaluate_retval
+
+		link_status=`ip link show ${1} 2> /dev/null`
+		if [ -n "${link_status}" ]
+		then
+			if ! echo "${link_status}" | grep -q UP
+			then
+				boot_mesg "Bringing up the ${LINK}.${VLAN} interface..."
+				ip link set ${LINK}.${VLAN} up
+				evaluate_retval
+			fi
+		fi
+
 		boot_mesg "Adding IPv4 address ${IP} to the ${1} interface..."
 		ip addr add ${args} dev ${1}
 		evaluate_retval
@@ -85,6 +107,10 @@
 		boot_mesg "Removing IPv4 address ${IP} from the ${1} interface..."
 		ip addr del ${args} dev ${1}
 		evaluate_retval
+
+		boot_mesg "Removing VLAN ${VLAN} from the ${LINK} interface..."
+		vconfig rem ${LINK}.${VLAN}
+		evaluate_retval
 	;;
 	
 	*)
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to