From: Zhu Yanjun <Yanjun.Zhu@windriver.com>
To: <netdev@vger.kernel.org>, <davem@redhat.com>
Subject: [PATCH 1/1] bridge: turn off carrier when the bridge is created
Date: Tue, 10 Mar 2015 15:09:42 +0800 [thread overview]
Message-ID: <1425971382-14177-2-git-send-email-Yanjun.Zhu@windriver.com> (raw)
In-Reply-To: <1425971382-14177-1-git-send-email-Yanjun.Zhu@windriver.com>
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@gmail.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Zhu Yanjun <Yanjun.Zhu@windriver.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
next prev parent reply other threads:[~2015-03-10 7:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-10 7:09 [PATCH 0/1] bridge: turn off carrier when the bridge is created Zhu Yanjun
2015-03-10 7:09 ` Zhu Yanjun [this message]
2015-03-11 2:39 ` [PATCH 1/1] " yzhu1
2015-03-11 4:03 ` David Miller
2015-03-11 5:26 ` Stephen Hemminger
2015-03-11 5:29 ` David Miller
2015-03-11 6:16 ` yzhu1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1425971382-14177-2-git-send-email-Yanjun.Zhu@windriver.com \
--to=yanjun.zhu@windriver.com \
--cc=davem@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).