File 0030-ifup-bridge-handle-1-100-sec-precision-stp-times.patch of Package sysconfig.openSUSE_12.1_Update
From c4e81511d3346e93f2194f6288c057e321ec461e Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.com>
Date: Tue, 8 Jan 2013 15:38:59 +0100
Subject: [PATCH] ifup-bridge: handle 1/100 sec precision stp times
References: bnc#753387,bnc#794720
Upstream: yes
---
scripts/ifup-bridge | 14 +++++++++++---
1 Datei geändert, 11 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)
diff --git a/scripts/ifup-bridge b/scripts/ifup-bridge
index ec04e49..0ac9b5d 100755
--- a/scripts/ifup-bridge
+++ b/scripts/ifup-bridge
@@ -95,19 +95,27 @@ apply_constraints()
local -i min=$(($2))
local -i max=$(($3))
local def=$4
+ local val=${!var}
+ local tmp
- test -n "${!var}" || return
- if test $((${!var})) -lt $min ; then
+ case $val in
+ "") return 0 ;;
+ *[,.]*) tmp=${val##*[.,]}
+ val=$((${val%%[.,]*} * 100 + ${tmp:0:2})) ;;
+ *) val=$(($val * 100)) ;;
+ esac
+ if test $((${val})) -lt $(($min * 100)) ; then
def=${def:-$min}
message_if_not_run_from_rc \
"Warning: Correcting $var from ${!var} to $def"
eval "${var}=$def"
- elif test $((${!var})) -gt $max ; then
+ elif test $((${val})) -gt $(($max * 100)) ; then
def=${def:-$max}
message_if_not_run_from_rc \
"Warning: Correcting $var from ${!var} to $def"
eval "${var}=$def"
fi
+ return 0
}
######################################################################
--
1.7.10.4