From: Gurucharan Shetty <gshetty@nicira.com>
Date: Mon, 18 Mar 2013 17:18:15 +0000 (-0700)
Subject: rhel: Set STP of a bridge during bridge creation.
X-Git-Tag: sliver-openvswitch-1.10.90-1~10^2~51
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=32aa46891af5e173144d672e15fec7c305f9a4f3;p=sliver-openvswitch.git

rhel: Set STP of a bridge during bridge creation.

This patch sets the value of STP (if provided) at the same
time of bridge creation. This eliminates an extra ovs-vsctl call
and does not let ovs-vswitchd run briefly with STP not enabled.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
---

diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index b36252020..8904c59b9 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -70,7 +70,8 @@ case "$TYPE" in
 		# because it remained in the OVSDB for some reason, but it won't be up.
 		if check_device_down "${DEVICE}"; then
 			ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIONS \
-			${OVS_EXTRA+-- $OVS_EXTRA}
+			${OVS_EXTRA+-- $OVS_EXTRA} \
+			${STP+-- set bridge "$DEVICE" stp_enable="${STP}"}
 		else
 			OVSBRIDGECONFIGURED="yes"
 		fi
@@ -94,7 +95,6 @@ case "$TYPE" in
 			[ "${OVSBRIDGECONFIGURED}" != "yes" ]; then
 			${OTHERSCRIPT} ${CONFIG}
 		fi
-		[ -n "${STP}" ] && ovs-vsctl --no-wait set bridge "${DEVICE}" stp_enable="${STP}"
 		exit 0
 		;;
 	OVSPort)