+ return 0
+}
+
+set_interface_ifname() {
+ local config="$1"
+ local ifname="$2"
+
+ config_get device "$1" device
+ uci_set_state network "$config" ifname "$ifname"
+ uci_set_state network "$config" device "$device"
+}
+
+setup_interface() {
+ local iface="$1"
+ local config="$2"
+ local proto
+ local macaddr
+
+ [ -n "$config" ] || {
+ config=$(find_config "$iface")
+ [ "$?" = 0 ] || return 1
+ }
+ proto="${3:-$(config_get "$config" proto)}"
+
+ prepare_interface "$iface" "$config" || return 0
+
+ [ "$iface" = "br-$config" ] && {
+ # need to bring up the bridge and wait a second for
+ # it to switch to the 'forwarding' state, otherwise
+ # it will lose its routes...
+ ifconfig "$iface" up
+ sleep 1
+ }