summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_device.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2011-03-07 09:34:06 +0100
committerDavid S. Miller <davem@davemloft.net>2011-03-14 22:29:02 +0100
commit1faa4356a3bd89ea11fb92752d897cff3a20ec0e (patch)
tree31bf972b0ee42105bceb79e09f2a8b82d9d9b942 /net/bridge/br_device.c
parentdrivers/net: fix build warnings with CONFIG_PM_SLEEP disabled (diff)
downloadlinux-1faa4356a3bd89ea11fb92752d897cff3a20ec0e.tar.xz
linux-1faa4356a3bd89ea11fb92752d897cff3a20ec0e.zip
bridge: control carrier based on ports online
This makes the bridge device behave like a physical device. In earlier releases the bridge always asserted carrier. This changes the behavior so that bridge device carrier is on only if one or more ports are in the forwarding state. This should help IPv6 autoconfiguration, DHCP, and routing daemons. I did brief testing with Network and Virt manager and they seem fine, but since this changes behavior of bridge, it should wait until net-next (2.6.39). Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr> Tested-By: Adam Majer <adamm@zombino.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_device.c')
-rw-r--r--net/bridge/br_device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 1461b19efd38..21e5901186ea 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -78,6 +78,8 @@ static int br_dev_open(struct net_device *dev)
{
struct net_bridge *br = netdev_priv(dev);
+ netif_carrier_off(dev);
+
br_features_recompute(br);
netif_start_queue(dev);
br_stp_enable_bridge(br);
@@ -94,6 +96,8 @@ static int br_dev_stop(struct net_device *dev)
{
struct net_bridge *br = netdev_priv(dev);
+ netif_carrier_off(dev);
+
br_stp_disable_bridge(br);
br_multicast_stop(br);