]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
ifup: do not dhcp on network interface of secondary stack
authorWANG Chao <chaowang@redhat.com>
Fri, 13 Sep 2013 14:28:44 +0000 (22:28 +0800)
committerHarald Hoyer <harald@redhat.com>
Fri, 13 Sep 2013 15:04:16 +0000 (17:04 +0200)
Configure cmdline to:
 ip=br0:dhcp bridge=br0:bond0 bond=bond0:eth0

By default ifup bond0 will run dhcp on bond0, which is wrong. bond0
isn't the top interface. we should really run dhcp on br0.

So if we ifup an network interface on secondary stack, we should not
dhcp. Fix this issue with this patch.

modules.d/40network/ifup.sh

index 32616470c24753ac506da269114d32bcafed7f09..9f6f44949b5b69bffc13fc62f52e26822ab17b99 100755 (executable)
@@ -336,6 +336,13 @@ for p in $(getargs ip=); do
     exit 0
 done
 
+# netif isn't the top stack? Then we should exit here.
+# eg. netif is bond0. br0 is on top of it. dhcp br0 is correct but dhcp
+#     bond0 doesn't make sense.
+if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then
+    exit 0
+fi
+
 # no ip option directed at our interface?
 if [ ! -e /tmp/setup_net_${netif}.ok ]; then
     do_dhcp -4