summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2020-07-12 18:50:18 +0200
committerFelix Fietkau <nbd@nbd.name>2020-07-18 17:41:57 +0200
commitccd9ddc10219ae90784411c7774a0d56dbced59b (patch)
treed95f8f41e6107c8e48f252afeea67b5696fee5e2 /system-linux.c
parentcb0c07b48fdd137b035fee065e1db1aa7e6c0b1a (diff)
bridge: add support for turning on vlan_filtering
If we want a bridge to be vlan aware we need to be able to turn on filtering. Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/system-linux.c b/system-linux.c
index 3b09bbb..97b38e7 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -470,6 +470,11 @@ static void system_set_sendredirects(struct device *dev, const char *val)
system_set_dev_sysctl("/proc/sys/net/ipv4/conf/%s/send_redirects", dev->ifname, val);
}
+static void system_bridge_set_vlan_filtering(struct device *dev, const char *val)
+{
+ system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/vlan_filtering", dev->ifname, val);
+}
+
static int system_get_sysctl(const char *path, char *buf, const size_t buf_sz)
{
int fd = -1, ret = -1;
@@ -1170,6 +1175,7 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg)
system_bridge_set_forward_delay(bridge, buf);
system_bridge_conf_multicast(bridge, cfg, buf, sizeof(buf));
+ system_bridge_set_vlan_filtering(bridge, cfg->vlan_filtering ? "1" : "0");
snprintf(buf, sizeof(buf), "%d", cfg->priority);
system_bridge_set_priority(bridge, buf);