diff mbox

[1/1] bridge: turn off carrier when the bridge is created

Message ID 1425971382-14177-2-git-send-email-Yanjun.Zhu@windriver.com
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

yzhu1 March 10, 2015, 7:09 a.m. UTC
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(+)

Comments

yzhu1 March 11, 2015, 2:39 a.m. UTC | #1
Hi, Stephen && David

Any comment?

Best Regards!
Zhu Yanjun
On 03/10/2015 03:09 PM, Zhu Yanjun wrote:
> 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);
>   }

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 11, 2015, 4:03 a.m. UTC | #2
From: yzhu1 <Yanjun.Zhu@windriver.com>
Date: Wed, 11 Mar 2015 10:39:53 +0800

> Hi, Stephen && David
> 
> Any comment?

Asking Stephen to look at this more times will not make him respond
any faster.  I see your posting, he sees it, everyone sees it.

If he's too busy to look into this, that's just the state of affairs
right now and you just need to be patient.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Hemminger March 11, 2015, 5:26 a.m. UTC | #3
On Wed, 11 Mar 2015 00:03:50 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: yzhu1 <Yanjun.Zhu@windriver.com>
> Date: Wed, 11 Mar 2015 10:39:53 +0800
> 
> > Hi, Stephen && David
> > 
> > Any comment?
> 
> Asking Stephen to look at this more times will not make him respond
> any faster.  I see your posting, he sees it, everyone sees it.
> 
> If he's too busy to look into this, that's just the state of affairs
> right now and you just need to be patient.
> 
> Thanks.

This was discussed and changed long ago (before git was used).
Initially in 2.5 the bridge carrier was changed to work as you have
described but this broke some user. Therefore it was decided that the
best thing to do was keep the carrier always on for the bridge.

You might be able to find the commit by using one of the kernel
ancient history git trees. Kernel archeology is fun but 
too time consuming for me to bother with.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 11, 2015, 5:29 a.m. UTC | #4
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 10 Mar 2015 22:26:34 -0700

> This was discussed and changed long ago (before git was used).
> Initially in 2.5 the bridge carrier was changed to work as you have
> described but this broke some user. Therefore it was decided that the
> best thing to do was keep the carrier always on for the bridge.
> 
> You might be able to find the commit by using one of the kernel
> ancient history git trees. Kernel archeology is fun but 
> too time consuming for me to bother with.

And for that reason we are probably stuck with the current behavior.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
yzhu1 March 11, 2015, 6:16 a.m. UTC | #5
On 03/11/2015 01:26 PM, Stephen Hemminger wrote:
> On Wed, 11 Mar 2015 00:03:50 -0400 (EDT)
> David Miller <davem@davemloft.net> wrote:
>
>> From: yzhu1 <Yanjun.Zhu@windriver.com>
>> Date: Wed, 11 Mar 2015 10:39:53 +0800
>>
>>> Hi, Stephen && David
>>>
>>> Any comment?
>> Asking Stephen to look at this more times will not make him respond
>> any faster.  I see your posting, he sees it, everyone sees it.
>>
>> If he's too busy to look into this, that's just the state of affairs
>> right now and you just need to be patient.
>>
>> Thanks.
> This was discussed and changed long ago (before git was used).
> Initially in 2.5 the bridge carrier was changed to work as you have
> described but this broke some user. Therefore it was decided that the
> best thing to do was keep the carrier always on for the bridge.
>
> You might be able to find the commit by using one of the kernel
> ancient history git trees. Kernel archeology is fun but
> too time consuming for me to bother with.
>
>
Thanks for your explanations.

Best Regards!
Zhu Yanjun
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);
 }