mirror of
https://github.com/openwrt/routing.git
synced 2026-04-15 10:51:56 +00:00
Apply ap_isolation default value '0' if option ap_isolation is
not present in the batadv_vlan interface configuration.
Default value '0' should be applied for the use case where
"option ap_isolation '1'" was present, is removed, and
'service network reload' is executed.
This is required for proper LuCI integration, because if an option
is set to the default value, LuCI removes the option.
Also take into account $INCLUDE_ONLY as in other /lib/netifd/proto
scripts and as recommended in the guide at:
https://openwrt.org/docs/guide-developer/network-scripting
Signed-off-by: Bastiaan Stougie <wififreedom2026@protonmail.com>
(cherry picked from commit 9777081ec0)
32 lines
517 B
Bash
Executable File
32 lines
517 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ -n "$INCLUDE_ONLY" ] || {
|
|
. /lib/functions.sh
|
|
. ../netifd-proto.sh
|
|
init_proto "$@"
|
|
}
|
|
|
|
proto_batadv_vlan_init_config() {
|
|
proto_config_add_boolean 'ap_isolation:bool'
|
|
}
|
|
|
|
proto_batadv_vlan_setup() {
|
|
local config="$1"
|
|
local iface="$2"
|
|
|
|
# batadv_vlan options
|
|
local ap_isolation
|
|
|
|
json_get_vars ap_isolation
|
|
|
|
batctl vlan "$iface" ap_isolation "${ap_isolation:-0}"
|
|
proto_init_update "$iface" 1
|
|
proto_send_update "$config"
|
|
}
|
|
|
|
proto_batadv_vlan_teardown() {
|
|
local cfg="$1"
|
|
}
|
|
|
|
add_protocol batadv_vlan
|