aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initscripts.spec1
-rwxr-xr-xsysconfig/network-scripts/ifup-eth6
2 files changed, 5 insertions, 2 deletions
diff --git a/initscripts.spec b/initscripts.spec
index e3242b9c..4043a5d1 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -27,6 +27,7 @@ Conflicts: redhat-release < 7.5-0.11
Requires: udev >= 125-1
Requires: cpio
Requires: hostname
+Requires: bc
Conflicts: ipsec-tools < 0.8.0-2
Conflicts: NetworkManager < 0.9.9.0-37.git20140131.el7
Requires(pre): /usr/sbin/groupadd
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index 1a9866c1..f39cc01a 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -86,9 +86,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