summaryrefslogtreecommitdiffhomepage
path: root/system-linux.c
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@c0d3.blue>2015-05-26 21:49:11 +0200
committerFelix Fietkau <nbd@openwrt.org>2015-05-27 17:02:41 +0200
commit6b74746cbf12d5b8421f68e99a4139abacec924b (patch)
treeae5ec7a9090abf990148f6a7166b36e5d06ab12c /system-linux.c
parent5990d1126fd33665e106508ebcbadfbb2d703d8e (diff)
bridge: allow setting hash_max value
If the number of entries in the MDB exceeds hash_max then the multicast snooping capabilities of the bridge are disabled automatically. The default value for hash_max is 512 which is already exceeded by some wireless community mesh networks. They need to be able to set a higher value. Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/system-linux.c b/system-linux.c
index 0ba729e..6dc9acd 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -791,6 +791,7 @@ sec_to_jiffies(int val)
int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg)
{
+ char buf[64];
unsigned long args[4] = {};
if (ioctl(sock_ioctl, SIOCBRADDBR, bridge->ifname) < 0)
@@ -810,6 +811,10 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg)
system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/multicast_querier",
bridge->ifname, cfg->multicast_querier ? "1" : "0");
+ snprintf(buf, sizeof(buf), "%i", cfg->hash_max);
+ system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/hash_max",
+ bridge->ifname, buf);
+
args[0] = BRCTL_SET_BRIDGE_PRIORITY;
args[1] = cfg->priority;
system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args);