From dd45506a40f3332cef96cc8ca7e258561a200ec0 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Mon, 12 Dec 2011 18:12:35 -0800 Subject: [PATCH] net/bonding: ensure slave interfaces are down before adding. The old ifenslave binary forcibly set new slave interface to down before adding into the kernel, as a way of show it's version to the kernel. We need to duplicate this so that the kernel doesn't think it's an old ifenslave version using the bonding setup interface. X-Gentoo-Bug: 391881 X-Gentoo-Bug-URL: https://bugs.gentoo.org/391881 Signed-off-by: Robin H. Johnson Thanks-to: Yun Zheng Hu --- net/bonding.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/bonding.sh b/net/bonding.sh index 5ccd1f57..6a83a8c3 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -95,16 +95,22 @@ bonding_pre_start() _up # finally add in slaves + # things needed in the process, and if they are done by ifenslave, openrc, and/or the kernel. + # down new slave interface: ifenslave, openrc + # set mtu: ifenslave, kernel + # set slave MAC: ifenslave, kernel eoutdent if [ -d /sys/class/net ]; then sys_bonding_path=/sys/class/net/"${IFACE}"/bonding if [ -n "${primary}" ]; then + IFACE=$primary _down echo "+${primary}" >$sys_bonding_path/slaves echo "${primary}" >$sys_bonding_path/primary fi for s in ${slaves}; do [ "${s}" = "${primary}" ] && continue if ! grep -q ${s} $sys_bonding_path/slaves; then + IFACE=$s _down echo "+${s}" >$sys_bonding_path/slaves fi done