diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-07-15 17:18:20 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-07-19 10:46:02 +0200 |
commit | 0e8cea0f2acdae3812f9603ee046055acd89d717 (patch) | |
tree | effec0c99fc1bc6e72ce70b39b92d31026a55f54 /device.c | |
parent | 82bcb641602579f339e9addafe5f1869134a0cd1 (diff) |
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.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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) { |