mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
64f629e207
This package uses BPF to create a fast path which improves bridging performance by bypassing the bridge layer. It also supports creating tc offload rules for hardware that supports it. Hardware offload support can be used with MT7622 + MT7915 once it is merged Signed-off-by: Felix Fietkau <nbd@nbd.name>
45 lines
710 B
Bash
45 lines
710 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (c) 2021 OpenWrt.org
|
|
|
|
START=19
|
|
|
|
USE_PROCD=1
|
|
PROG=/usr/sbin/bridger
|
|
|
|
add_blacklist() {
|
|
cfg="$1"
|
|
|
|
config_get blacklist "$cfg" blacklist
|
|
for i in $blacklist; do
|
|
json_add_string "" "$i"
|
|
done
|
|
}
|
|
|
|
reload_service() {
|
|
config_load bridger
|
|
|
|
json_init
|
|
json_add_string name "config"
|
|
json_add_array devices
|
|
config_foreach add_blacklist defaults
|
|
json_close_array
|
|
|
|
ubus call bridger set_blacklist "$(json_dump)"
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger bridger
|
|
}
|
|
|
|
start_service() {
|
|
procd_open_instance
|
|
procd_set_param command "$PROG"
|
|
procd_set_param respawn
|
|
procd_close_instance
|
|
}
|
|
|
|
service_started() {
|
|
ubus -t 10 wait_for bridger
|
|
[ $? = 0 ] && reload_service
|
|
}
|