summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-07-15 17:18:20 +0200
committerFelix Fietkau <nbd@nbd.name>2020-07-19 10:46:02 +0200
commit0e8cea0f2acdae3812f9603ee046055acd89d717 (patch)
treeeffec0c99fc1bc6e72ce70b39b92d31026a55f54 /device.c
parent82bcb641602579f339e9addafe5f1869134a0cd1 (diff)
downloadnetifd-0e8cea0f2acdae3812f9603ee046055acd89d717.tar.gz
bridge: add support for VLAN filtering
VLANs can be defined using bridge-vlan sections, like the following example: config bridge-vlan option device 'switch0' option vlan '1' option ports "lan1 lan2 lan3 lan4:t*" Each member port can be confgured with optional attributes after ':' - t: member port is tagged - *: This is the primary VLAN for the port (PVID) VLAN member interfaces are automatically added as bridge members Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'device.c')
-rw-r--r--device.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/device.c b/device.c
index 70cb6a7..5e3a741 100644
--- a/device.c
+++ b/device.c
@@ -109,6 +109,21 @@ void device_unlock(void)
device_free_unused(NULL);
}
+void device_vlan_update(bool done)
+{
+ struct device *dev;
+
+ avl_for_each_element(&devices, dev, avl) {
+ if (!dev->vlans.update)
+ continue;
+
+ if (!done)
+ vlist_update(&dev->vlans);
+ else
+ vlist_flush(&dev->vlans);
+ }
+}
+
static int set_device_state(struct device *dev, bool state)
{
if (state) {