Oldnet: bonding: set miimon correctly

Miimon needs to be activated before downdelay is set.

X-Gentoo-Bug: 421757
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=421757
This commit is contained in:
Lorand Kelemen 2012-10-17 12:53:17 -05:00 committed by William Hubbs
parent 6d84a4aed8
commit f671e0a28f

View File

@ -74,12 +74,23 @@ bonding_pre_start()
eerror "Failed to configure $n (${n}_${IFVAR})" eerror "Failed to configure $n (${n}_${IFVAR})"
fi fi
done done
# Configure link monitoring
for x in /sys/class/net/"${IFACE}"/bonding/miimon; do
[ -f "${x}" ] || continue
n=${x##*/}
eval s=\$${n}_${IFVAR}
if [ -n "${s}" ]; then
einfo "Setting ${n}: ${s}"
echo "${s}" >"${x}" || \
eerror "Failed to configure $n (${n}_${IFVAR})"
fi
done
# Nice and dynamic for remaining options:) # Nice and dynamic for remaining options:)
[ -d /sys/class/net ] && for x in /sys/class/net/"${IFACE}"/bonding/*; do [ -d /sys/class/net ] && for x in /sys/class/net/"${IFACE}"/bonding/*; do
[ -f "${x}" ] || continue [ -f "${x}" ] || continue
n=${x##*/} n=${x##*/}
eval s=\$${n}_${IFVAR} eval s=\$${n}_${IFVAR}
[ "${n}" != "mode" ] || continue [ "${n}" != "mode" -o "${n}" != "miimon" ] || continue
if [ -n "${s}" ]; then if [ -n "${s}" ]; then
einfo "Setting ${n}: ${s}" einfo "Setting ${n}: ${s}"
echo "${s}" >"${x}" || \ echo "${s}" >"${x}" || \