summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-03-13 12:52:43 +0100
committerFelix Fietkau <nbd@nbd.name>2018-03-13 12:57:40 +0100
commitc06f84238952211b35c2940a82fcce3fcc3221c1 (patch)
tree10c9006c5bce37cc64f2939177ee4e22b50efb5d /system-linux.c
parent1f5a29c3de6e3fec5883796ee772e25d56db6a69 (diff)
device: add support for setting the isolate options for bridge ports
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/system-linux.c b/system-linux.c
index 4f3b9b0..0ca5256 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -346,6 +346,11 @@ static void system_bridge_set_hairpin_mode(struct device *dev, const char *val)
system_set_dev_sysctl("/sys/class/net/%s/brport/hairpin_mode", dev->ifname, val);
}
+static void system_bridge_set_isolate_mode(struct device *dev, const char *val)
+{
+ system_set_dev_sysctl("/sys/class/net/%s/brport/isolate_mode", dev->ifname, val);
+}
+
static void system_bridge_set_multicast_router(struct device *dev, const char *val, bool bridge)
{
system_set_dev_sysctl(bridge ? "/sys/class/net/%s/bridge/multicast_router" :
@@ -748,6 +753,10 @@ int system_bridge_addif(struct device *bridge, struct device *dev)
!dev->settings.unicast_flood)
system_bridge_set_unicast_flood(dev, "0");
+ if (dev->settings.flags & DEV_OPT_ISOLATE &&
+ dev->settings.isolate)
+ system_bridge_set_isolate_mode(dev, "1");
+
return ret;
}