Author: baggins
Date: Fri Jan 13 14:32:11 2012
New Revision: 12466

Modified:
   rc-scripts/trunk/rc.d/init.d/network
Log:
- stable sort for BOOTPRIO= devices, so vlan ifaces will be
  after their NIC eth counterparts
- treat macvlan and macvtap interfaces specially - they may be created
  on almost enything


Modified: rc-scripts/trunk/rc.d/init.d/network
==============================================================================
--- rc-scripts/trunk/rc.d/init.d/network        (original)
+++ rc-scripts/trunk/rc.d/init.d/network        Fri Jan 13 14:32:11 2012
@@ -130,7 +130,7 @@
        if [ -n "$bootprio" ]; then
                # find all the interfaces besides loopback.
                interfaces_boot=`
-                       for a in $(echo "$bootprio" | sort -t= -n -k2,2); do
+                       for a in $(echo "$bootprio" | sort -t= -s -n -k2,2); do
                                i="${a%:BOOTPRIO*}"
                                case $i in
                                        *ifcfg-lo) continue ;;
@@ -143,7 +143,7 @@
                interfaces_boot=`
                        for i in $ifcfg_files; do
                                case ${i##*/} in
-                                       
ifcfg-lo|ifcfg-sit*|ifcfg-atm*|ifcfg-lec*|ifcfg-nas*|ifcfg-br*|ifcfg-*.*) 
continue ;;
+                                       
ifcfg-lo|ifcfg-sit*|ifcfg-atm*|ifcfg-lec*|ifcfg-nas*|ifcfg-br*|ifcfg-macvlan*|ifcfg-macvtap*|ifcfg-*.*)
 continue ;;
                                esac
                                ONBOOT=""; . "$i" 2>/dev/null
                                [ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
@@ -172,6 +172,17 @@
                        done
                `
 
+               interfaces_virt_boot=`
+                       for i in $ifcfg_files; do
+                               case ${i##*/} in
+                                       ifcfg-macvtap*|ifcfg-macvlan*) ;;
+                                       *) continue ;;
+                               esac
+                               ONBOOT=""; . "$i" 2>/dev/null
+                               [ ${ONBOOT:-no} = yes ] && echo "${i##*/ifcfg-}"
+                       done
+               `
+
                interfaces_sit_boot=`
                        for i in $ifcfg_files; do
                                case ${i##*/} in
@@ -207,6 +218,10 @@
                run_cmd -a "$(nls 'Bringing up bridge interface %s' "$i")" 
/sbin/ifup $i boot
        done
 
+       for i in $interfaces_virt_boot ; do
+               run_cmd -a "$(nls 'Bringing up virtual interface %s' "$i")" 
/sbin/ifup $i boot
+       done
+
        for i in $tunnels; do
                run_cmd -a "$(nls 'Setting tunnel %s' "$i")" /sbin/tnlup $i boot
                run_cmd -a "$(nls 'Bringing up tunnel interface %s' "$i")" 
/sbin/ifup tnlcfg-$i boot
@@ -235,6 +250,10 @@
                run_cmd -a "$(nls 'Removing tunnel %s' "$i")" /sbin/tnldown $i 
boot
        done
 
+       for i in $interfaces_virt_boot ; do
+               run_cmd -a "$(nls 'Shutting down virtual interface %s' "$i")" 
/sbin/ifup $i boot
+       done
+
        for i in $interfaces_br_boot ; do
                run_cmd -a "$(nls 'Shutting down bridge interface %s' "$i")" 
/sbin/ifdown $i boot
        done
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to