1 From 6ae4ae8e512bd229f806c22f8a2cd751e4f987c2 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
3 Date: Sat, 23 May 2015 03:12:34 +0200
4 Subject: [PATCH] bridge: allow setting hash_max + multicast_router if
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Network managers like netifd (used in OpenWRT for instance) try to
11 configure interface options after creation but before setting the
14 Unfortunately the sysfs / bridge currently only allows to configure the
15 hash_max and multicast_router options when the bridge interface is up.
16 But since br_multicast_init() doesn't start any timers and only sets
17 default values and initializes timers it should be save to reconfigure
18 the default values after that, before things actually get active after
21 Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
22 Signed-off-by: David S. Miller <davem@davemloft.net>
24 net/bridge/br_multicast.c | 24 +++---------------------
25 1 file changed, 3 insertions(+), 21 deletions(-)
27 --- a/net/bridge/br_multicast.c
28 +++ b/net/bridge/br_multicast.c
29 @@ -1948,11 +1948,9 @@ out:
31 int br_multicast_set_router(struct net_bridge *br, unsigned long val)
36 spin_lock_bh(&br->multicast_lock);
37 - if (!netif_running(br->dev))
42 @@ -1963,13 +1961,8 @@ int br_multicast_set_router(struct net_b
43 br->multicast_router = val;
53 spin_unlock_bh(&br->multicast_lock);
56 @@ -1978,11 +1971,9 @@ unlock:
57 int br_multicast_set_port_router(struct net_bridge_port *p, unsigned long val)
59 struct net_bridge *br = p->br;
63 spin_lock(&br->multicast_lock);
64 - if (!netif_running(br->dev) || p->state == BR_STATE_DISABLED)
69 @@ -2004,13 +1995,8 @@ int br_multicast_set_port_router(struct
71 br_multicast_add_router(br, p);
80 spin_unlock(&br->multicast_lock);
83 @@ -2115,15 +2101,11 @@ unlock:
85 int br_multicast_set_hash_max(struct net_bridge *br, unsigned long val)
90 struct net_bridge_mdb_htable *mdb;
92 spin_lock_bh(&br->multicast_lock);
93 - if (!netif_running(br->dev))
97 if (!is_power_of_2(val))