config_get netmask "$config" netmask
config_get gateway "$config" gateway
config_get metric "$config" metric
+ config_get mtu "$config" mtu
# make sure there is a gateway and a target
[ -n "$target" ] || {
dest="${dest:--host "$target"}"
/sbin/route add $dest ${gateway:+gw "$gateway"} \
- ${dev:+dev "$dev"} ${metric:+ metric "$metric"}
+ ${dev:+dev "$dev"} ${metric:+ metric "$metric"} \
+ ${mtu:+mss "$mtu"}
}
add_route6() {
config_get target "$config" target
config_get gateway "$config" gateway
config_get metric "$config" metric
+ config_get mtu "$config" mtu
# make sure there is a gateway and a target
[ -n "$target" ] || {
}
/sbin/route -A inet6 add $target ${gateway:+gw "$gateway"} \
- ${dev:+dev "$dev"} ${metric:+ metric "$metric"}
+ ${dev:+dev "$dev"} ${metric:+ metric "$metric"} \
+ ${mtu:+mss "$mtu"}
}
case "$ACTION" in
;;
ifdown)
# Bring down named aliases
+ local device=$(uci_get_state network "$INTERFACE" device)
local ifn
- for ifn in $(ifconfig | sed -ne "s/^\($DEVICE:[^[:space:]]\+\).*/\1/p"); do
+ for ifn in $(ifconfig | sed -ne "s/^\(\($DEVICE${device:+\|$device}\|br-$INTERFACE\):[^[:space:]]\+\).*/\1/p"); do
ifconfig "$ifn" down
done
;;