[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1425971382-14177-2-git-send-email-Yanjun.Zhu@windriver.com>
Date: Tue, 10 Mar 2015 15:09:42 +0800
From: Zhu Yanjun <Yanjun.Zhu@...driver.com>
To: <netdev@...r.kernel.org>, <davem@...hat.com>
Subject: [PATCH 1/1] bridge: turn off carrier when the bridge is created
When a bridge interface is created, there is no any sub interface
in it. In this case, the packets should not go to this bridge interface.
As such, carrier is turned off.
CC: David Ahern <dsahern@...il.com>
Suggested-by: Stephen Hemminger <stephen@...workplumber.org>
Signed-off-by: Zhu Yanjun <Yanjun.Zhu@...driver.com>
---
net/bridge/br_device.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index ffd379d..fcc4794 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -394,4 +394,8 @@ void br_dev_setup(struct net_device *dev)
br_netfilter_rtable_init(br);
br_stp_timer_init(br);
br_multicast_init(br);
+
+ /* Shutdown bridge to avoid packets */
+ if (netif_carrier_ok(dev))
+ netif_carrier_off(dev);
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists