diff options
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_input.c | 5 | ||||
-rw-r--r-- | net/bridge/br_stp.c | 3 | ||||
-rw-r--r-- | net/bridge/br_sysfs_br.c | 3 | ||||
-rw-r--r-- | net/bridge/br_sysfs_if.c | 3 |
4 files changed, 12 insertions, 2 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 30b88777c3df..5ee1a3682bf2 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
@@ -134,6 +134,10 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb) | |||
134 | if (skb->protocol == htons(ETH_P_PAUSE)) | 134 | if (skb->protocol == htons(ETH_P_PAUSE)) |
135 | goto drop; | 135 | goto drop; |
136 | 136 | ||
137 | /* If STP is turned off, then forward */ | ||
138 | if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0) | ||
139 | goto forward; | ||
140 | |||
137 | if (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev, | 141 | if (NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev, |
138 | NULL, br_handle_local_finish)) | 142 | NULL, br_handle_local_finish)) |
139 | return NULL; /* frame consumed by filter */ | 143 | return NULL; /* frame consumed by filter */ |
@@ -141,6 +145,7 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb) | |||
141 | return skb; /* continue processing */ | 145 | return skb; /* continue processing */ |
142 | } | 146 | } |
143 | 147 | ||
148 | forward: | ||
144 | switch (p->state) { | 149 | switch (p->state) { |
145 | case BR_STATE_FORWARDING: | 150 | case BR_STATE_FORWARDING: |
146 | rhook = rcu_dereference(br_should_route_hook); | 151 | rhook = rcu_dereference(br_should_route_hook); |
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index 6e63ec3f1fcf..0660515f3992 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c | |||
@@ -297,6 +297,9 @@ void br_topology_change_detection(struct net_bridge *br) | |||
297 | { | 297 | { |
298 | int isroot = br_is_root_bridge(br); | 298 | int isroot = br_is_root_bridge(br); |
299 | 299 | ||
300 | if (br->stp_enabled != BR_KERNEL_STP) | ||
301 | return; | ||
302 | |||
300 | pr_info("%s: topology change detected, %s\n", br->dev->name, | 303 | pr_info("%s: topology change detected, %s\n", br->dev->name, |
301 | isroot ? "propagating" : "sending tcn bpdu"); | 304 | isroot ? "propagating" : "sending tcn bpdu"); |
302 | 305 | ||
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 603d89248e71..ee4820aa1843 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -172,7 +172,8 @@ static ssize_t store_stp_state(struct device *d, | |||
172 | if (endp == buf) | 172 | if (endp == buf) |
173 | return -EINVAL; | 173 | return -EINVAL; |
174 | 174 | ||
175 | rtnl_lock(); | 175 | if (!rtnl_trylock()) |
176 | return restart_syscall(); | ||
176 | br_stp_set_enabled(br, val); | 177 | br_stp_set_enabled(br, val); |
177 | rtnl_unlock(); | 178 | rtnl_unlock(); |
178 | 179 | ||
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c index 02b2d50cce4d..4a3cdf8f3813 100644 --- a/net/bridge/br_sysfs_if.c +++ b/net/bridge/br_sysfs_if.c | |||
@@ -189,7 +189,8 @@ static ssize_t brport_store(struct kobject * kobj, | |||
189 | 189 | ||
190 | val = simple_strtoul(buf, &endp, 0); | 190 | val = simple_strtoul(buf, &endp, 0); |
191 | if (endp != buf) { | 191 | if (endp != buf) { |
192 | rtnl_lock(); | 192 | if (!rtnl_trylock()) |
193 | return restart_syscall(); | ||
193 | if (p->dev && p->br && brport_attr->store) { | 194 | if (p->dev && p->br && brport_attr->store) { |
194 | spin_lock_bh(&p->br->lock); | 195 | spin_lock_bh(&p->br->lock); |
195 | ret = brport_attr->store(p, val); | 196 | ret = brport_attr->store(p, val); |