aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initscripts.spec1
-rwxr-xr-xnetwork-scripts/ifup-eth6
2 files changed, 5 insertions, 2 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 248807cb..1679d342 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -94,6 +94,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%shared_requirements
+Requires: bc
Requires: dbus
Requires: gawk
Requires: grep
diff --git a/network-scripts/ifup-eth b/network-scripts/ifup-eth
index b55db79e..73a6c834 100755
--- a/network-scripts/ifup-eth
+++ b/network-scripts/ifup-eth
@@ -89,9 +89,11 @@ if [ "${TYPE}" = "Bridge" ]; then
forward_delay="$(convert2sec ${forward_delay} centi)"
fi
- forward_delay=$(expr ${forward_delay} \* 2 + 7)
+ forward_delay=$(bc -q <<< "${forward_delay} * 2 + 7")
- [ 0$LINKDELAY -lt $forward_delay ] && LINKDELAY=$forward_delay
+ # It's possible we are comparing floating point numbers here, therefore
+ # we are using 'bc' for comparison. The [ ] and [[ ]] do not work.
+ (( $(bc -l <<< "${LINKDELAY:-0} < ${forward_delay}") )) && LINKDELAY=${forward_delay}
unset forward_delay
fi