Blame SOURCES/0002-ifup-do-not-dhcp-on-network-interface-of-secondary-s.patch

18971c
From da63c0de561ce9ed158cc2438a1cc5fbb38c3758 Mon Sep 17 00:00:00 2001
18971c
From: WANG Chao <chaowang@redhat.com>
18971c
Date: Fri, 13 Sep 2013 22:28:44 +0800
18971c
Subject: [PATCH] ifup: do not dhcp on network interface of secondary stack
18971c
18971c
Configure cmdline to:
18971c
 ip=br0:dhcp bridge=br0:bond0 bond=bond0:eth0
18971c
18971c
By default ifup bond0 will run dhcp on bond0, which is wrong. bond0
18971c
isn't the top interface. we should really run dhcp on br0.
18971c
18971c
So if we ifup an network interface on secondary stack, we should not
18971c
dhcp. Fix this issue with this patch.
18971c
---
18971c
 modules.d/40network/ifup.sh | 7 +++++++
18971c
 1 file changed, 7 insertions(+)
18971c
18971c
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
18971c
index 32616470..9f6f4494 100755
18971c
--- a/modules.d/40network/ifup.sh
18971c
+++ b/modules.d/40network/ifup.sh
18971c
@@ -336,6 +336,13 @@ for p in $(getargs ip=); do
18971c
     exit 0
18971c
 done
18971c
 
18971c
+# netif isn't the top stack? Then we should exit here.
18971c
+# eg. netif is bond0. br0 is on top of it. dhcp br0 is correct but dhcp
18971c
+#     bond0 doesn't make sense.
18971c
+if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then
18971c
+    exit 0
18971c
+fi
18971c
+
18971c
 # no ip option directed at our interface?
18971c
 if [ ! -e /tmp/setup_net_${netif}.ok ]; then
18971c
     do_dhcp -4