Ensure bonding is only used if ethernet is also used.

This commit is contained in:
Scott Kilau 2022-06-16 10:50:07 -05:00
parent cdc6119fac
commit d94a7637d0

View File

@ -125,7 +125,7 @@ eth_wlan_up() {
# If running with Interface Bonding enabled, kill any existing # If running with Interface Bonding enabled, kill any existing
# wpa_supplicant that might be running and spawn our own instead # wpa_supplicant that might be running and spawn our own instead
if [[ "$BONDING_ENABLED" == "true" ]]; then if [[ "$BONDING_ENABLED" == "true" ]] && [[ "$ENABLE_USB_ETH" == "true" ]]; then
/opt/wz_mini/bin/busybox killall wpa_supplicant /opt/wz_mini/bin/busybox killall wpa_supplicant
wpa_supplicant -D nl80211 -i wlanold -c /tmp/wpa_supplicant.conf -B -s wpa_supplicant -D nl80211 -i wlanold -c /tmp/wpa_supplicant.conf -B -s
fi fi
@ -163,7 +163,7 @@ wlanold_check() {
eth_wlan_up eth_wlan_up
else else
echo "wlanold doesn't exist" echo "wlanold doesn't exist"
if [[ "$BONDING_ENABLED" == "true" ]]; then if [[ "$BONDING_ENABLED" == "true" ]] && [[ "$ENABLE_USB_ETH" == "true" ]]; then
rename_interface_and_setup_bonding bond0 "$BONDING_PRIMARY_INTERFACE" "$BONDING_SECONDARY_INTERFACE" rename_interface_and_setup_bonding bond0 "$BONDING_PRIMARY_INTERFACE" "$BONDING_SECONDARY_INTERFACE"
else else
rename_interface $1 rename_interface $1
@ -284,7 +284,23 @@ if [[ "$ENABLE_USB_ETH" == "true" ]]; then
done done
if [[ "$BONDING_ENABLED" == "true" ]]; then if [[ "$BONDING_ENABLED" == "true" ]]; then
# Insert the bonding driver if requested if [[ "$BONDING_LINK_MONITORING_FREQ_MS" == "" ]]; then
"$BONDING_LINK_MONITORING_FREQ_MS" = "100"
fi
if [[ "$BONDING_DOWN_DELAY_MS" == "" ]]; then
"$BONDING_DOWN_DELAY_MS" = "5000"
fi
if [[ "$BONDING_UP_DELAY_MS" == "" ]]; then
"$BONDING_UP_DELAY_MS" = "5000"
fi
if [[ "$BONDING_PRIMARY_INTERFACE" == "" ]]; then
"$BONDING_PRIMARY_INTERFACE" = "eth0"
fi
if [[ "$BONDING_SECONDARY_INTERFACE" == "" ]]; then
"$BONDING_SECONDARY_INTERFACE" = "wlan0"
fi
# Insert the bonding driver into the kernel
insmod $KMOD_PATH/kernel/drivers/net/bonding/bonding.ko mode=active-backup miimon="$BONDING_LINK_MONITORING_FREQ_MS" downdelay="$BONDING_DOWN_DELAY_MS" updelay="$BONDING_UP_DELAY_MS" primary="$BONDING_PRIMARY_INTERFACE" insmod $KMOD_PATH/kernel/drivers/net/bonding/bonding.ko mode=active-backup miimon="$BONDING_LINK_MONITORING_FREQ_MS" downdelay="$BONDING_DOWN_DELAY_MS" updelay="$BONDING_UP_DELAY_MS" primary="$BONDING_PRIMARY_INTERFACE"
fi fi