aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/dsaconfig/files/dsaconfig.include
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-07-07 15:34:53 +0200
committerJo-Philipp Wich <jo@mein.io>2020-08-06 08:34:19 +0200
commit96b87196b0788d4cdaa81a49a65d198d9f6c90d2 (patch)
tree0588181c2970b363428dc10c49bd83e7e74a15f3 /package/network/config/dsaconfig/files/dsaconfig.include
parent4c73c34ec4215deb690bf03faea2a0fe725476f0 (diff)
downloadupstream-96b87196b0788d4cdaa81a49a65d198d9f6c90d2.tar.gz
upstream-96b87196b0788d4cdaa81a49a65d198d9f6c90d2.tar.bz2
upstream-96b87196b0788d4cdaa81a49a65d198d9f6c90d2.zip
dsaconfig: introduce package for UCI configuration of VLAN filter rules
This package provides the necessary files to translate `config dsa_vlan` and `config dsa_port` sections of `/etc/config/network` into appropriate bridge vlan filter rules. The approach of the configuration is to bridge all DSA ports into a logical bridge device, called "switch0" by default, and to set VLAN port membership, tagging state and PVID as specified by UCI on each port and on the switch bridge device itself, allowing logical interfaces to reference port VLAN groups by using "switch0.N" as ifname, where N denotes the VLAN ID. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/network/config/dsaconfig/files/dsaconfig.include')
-rwxr-xr-xpackage/network/config/dsaconfig/files/dsaconfig.include11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/network/config/dsaconfig/files/dsaconfig.include b/package/network/config/dsaconfig/files/dsaconfig.include
new file mode 100755
index 0000000000..4ac11d8061
--- /dev/null
+++ b/package/network/config/dsaconfig/files/dsaconfig.include
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+setup_switch() {
+ # Skip switch setup on network restart. The netifd process
+ # will be started afterwards and remove all interfaces again...
+ if [ "$initscript" = /etc/init.d/network ] && [ "$action" = restart ]; then
+ return 0
+ fi
+
+ /sbin/dsaconfig apply 2>&1 | logger -t dsaconfig
+}