]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: support vlan tagged bonding
authorCong Wang <xiyou.wangcong@gmail.com>
Thu, 21 Jun 2012 03:44:35 +0000 (11:44 +0800)
committerHarald Hoyer <harald@redhat.com>
Thu, 21 Jun 2012 09:17:36 +0000 (11:17 +0200)
This patch adds support of vlan tagged bonding, for example,
bond0.2. In case of regression, I also tested bond0 and eth0.2,
all work fine.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
modules.d/40network/ifup.sh
modules.d/40network/net-genrules.sh

index 31eb9665d323af1a875cf19f153d15e328db5309..316a21ad53112a9929c7e3395d72a0359134fa43 100755 (executable)
@@ -188,7 +188,7 @@ if [ -e /tmp/bridge.info ]; then
         brctl setfd $bridgename 0
         for ethname in $ethnames ; do
             if [ "$ethname" = "$bondname" ] ; then
-                DO_BOND_SETUP=yes ifup $bondname
+                DO_BOND_SETUP=yes ifup $bondname -m
             else
                 ip link set $ethname up
             fi
@@ -211,7 +211,11 @@ get_vid() {
 
 if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
     modprobe 8021q
-    ip link set "$phydevice" up
+    if [ "$phydevice" = "$bondname" ] ; then
+        DO_BOND_SETUP=yes ifup $phydevice -m
+    else
+        ip link set "$phydevice" up
+    fi
     wait_for_if_up "$phydevice"
     ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
 fi
index 99d0fe57e2d12c2e74e9094bc90aa617ddcebd0a..867abcf00a7fb4b52bc006381dc0484f9f05054a 100755 (executable)
@@ -21,19 +21,19 @@ fix_bootif() {
     # bridge: attempt only the defined interface
     if [ -e /tmp/bridge.info ]; then
         . /tmp/bridge.info
-        IFACES=${ethnames%% *}
+        IFACES+=" ${ethnames%% *}"
     fi
 
     # bond: attempt only the defined interface (override bridge defines)
     if [ -e /tmp/bond.info ]; then
         . /tmp/bond.info
         # It is enough to fire up only one
-        IFACES=${bondslaves%% *}
+        IFACES+=" ${bondslaves%% *}"
     fi
 
     if [ -e /tmp/vlan.info ]; then
         . /tmp/vlan.info
-        IFACES=$phydevice
+        IFACES+=" $phydevice"
     fi
 
     ifup='/sbin/ifup $env{INTERFACE}'