From: Michael Tremer Date: Sun, 23 Sep 2012 19:38:48 +0000 (+0000) Subject: Revert "stp: Remove function that switches protocols." X-Git-Tag: 005~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7d36d3fb882bab6b697201c08a645e639fac6e5;p=network.git Revert "stp: Remove function that switches protocols." This reverts commit 78570028ea72b1cb5ca28835f64057f3f030f02e. --- diff --git a/functions.stp b/functions.stp index 806c7afd..a23d15fb 100644 --- a/functions.stp +++ b/functions.stp @@ -93,6 +93,24 @@ function stp_get_name() { return ${EXIT_OK} } +function stp_bridge_set_protocol() { + local bridge=${1} + assert isset bridge + + local mode=${2} + assert isset mode + + if ! listmatch ${mode} ${STP_ALLOWED_MODES}; then + log WARNING "Unknown protocol version: ${mode}." + log WARNING "Using default mode." + + mode="${STP_DEFAULT_MODE}" + fi + + mstpctl setforcevers ${bridge} ${mode} + assert [ $? -eq 0 ] +} + function stp_bridge_get_protocol() { local bridge=${1}