All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bridge: leave carrier on for empty bridge
       [not found] <20111004041444.793960297@vyatta.com>
@ 2011-10-04  4:14 ` Stephen Hemminger
  2011-10-06 19:28   ` David Miller
  2011-10-04  4:14 ` [PATCH 2/2] bridge: allow forwarding some link local frames Stephen Hemminger
  1 sibling, 1 reply; 34+ messages in thread
From: Stephen Hemminger @ 2011-10-04  4:14 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: br-carrier-default.patch --]
[-- Type: text/plain, Size: 1058 bytes --]

This resolves a regression seen by some users of bridging.
Some users use the bridge like a dummy device. 
They expect to be able to put an IPv6 address on the device
with no ports attached. Although there are better ways of doing
this, there is no reason to not allow it.

Note: the bridge still will reflect the state of ports in the
bridge if there are any added.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
This fix needs to go to stable as well since it has
been reported as a regression.


--- a/net/bridge/br_device.c	2011-09-01 08:52:27.596631192 -0700
+++ b/net/bridge/br_device.c	2011-09-01 09:01:03.256611801 -0700
@@ -91,7 +91,6 @@ static int br_dev_open(struct net_device
 {
 	struct net_bridge *br = netdev_priv(dev);
 
-	netif_carrier_off(dev);
 	netdev_update_features(dev);
 	netif_start_queue(dev);
 	br_stp_enable_bridge(br);
@@ -108,8 +107,6 @@ static int br_dev_stop(struct net_device
 {
 	struct net_bridge *br = netdev_priv(dev);
 
-	netif_carrier_off(dev);
-
 	br_stp_disable_bridge(br);
 	br_multicast_stop(br);
 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 2/2] bridge: allow forwarding some link local frames
       [not found] <20111004041444.793960297@vyatta.com>
  2011-10-04  4:14 ` [PATCH 1/2] bridge: leave carrier on for empty bridge Stephen Hemminger
@ 2011-10-04  4:14 ` Stephen Hemminger
  2011-10-04 19:11   ` Benjamin Poirier
                     ` (3 more replies)
  1 sibling, 4 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-10-04  4:14 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: bridge-multicast-filter.patch --]
[-- Type: text/plain, Size: 5475 bytes --]

This is based on an earlier patch by Nick Carter with comments
by David Lamparter but with some refinements. Thanks for their patience
this is a confusing area with overlap of standards, user requirements,
and compatibility with earlier releases.

It adds a new sysfs attribute 
   /sys/class/net/brX/bridge/group_fwd_mask
that controls forwarding of frames with address of: 01-80-C2-00-00-0X
The default setting has no forwarding to retain compatibility.

One change from earlier releases is that forwarding of group
addresses is not dependent on STP being enabled or disabled. This
choice was made based on interpretation of tie 802.1 standards.
I expect complaints will arise because of this, but better to follow
the standard than continue acting incorrectly by default.

The filtering mask is writeable, but only values that don't forward
known control frames are allowed. It intentionally blocks attempts
to filter control protocols. For example: writing a 8 allows
forwarding 802.1X PAE addresses which is the most common request.

Reported-by: David Lamparter <equinox@diac24.net>
Original-patch-by: Nick Carter <ncarter100@gmail.com>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


---
 net/bridge/br_device.c   |    2 ++
 net/bridge/br_input.c    |   12 ++++++------
 net/bridge/br_private.h  |   11 +++++++++++
 net/bridge/br_sysfs_br.c |   34 ++++++++++++++++++++++++++++++++++
 4 files changed, 53 insertions(+), 6 deletions(-)

--- a/net/bridge/br_device.c	2011-10-03 11:08:42.648254251 -0700
+++ b/net/bridge/br_device.c	2011-10-03 11:08:43.932271613 -0700
@@ -358,6 +358,8 @@ void br_dev_setup(struct net_device *dev
 	memcpy(br->group_addr, br_group_address, ETH_ALEN);
 
 	br->stp_enabled = BR_NO_STP;
+	br->group_fwd_mask = BR_GROUPFWD_DEFAULT;
+
 	br->designated_root = br->bridge_id;
 	br->bridge_max_age = br->max_age = 20 * HZ;
 	br->bridge_hello_time = br->hello_time = 2 * HZ;
--- a/net/bridge/br_input.c	2011-10-03 11:08:32.944122866 -0700
+++ b/net/bridge/br_input.c	2011-10-03 11:18:31.063811030 -0700
@@ -162,14 +162,37 @@ rx_handler_result_t br_handle_frame(stru
 	p = br_port_get_rcu(skb->dev);
 
 	if (unlikely(is_link_local(dest))) {
-		/* Pause frames shouldn't be passed up by driver anyway */
-		if (skb->protocol == htons(ETH_P_PAUSE))
+		/*
+		 * See IEEE 802.1D Table 7-10 Reserved addresses
+		 *
+		 * Assignment		 		Value
+		 * Bridge Group Address		01-80-C2-00-00-00
+		 * (MAC Control) 802.3		01-80-C2-00-00-01
+		 * (Link Aggregation) 802.3	01-80-C2-00-00-02
+		 * 802.1X PAE address		01-80-C2-00-00-03
+		 *
+		 * 802.1AB LLDP 		01-80-C2-00-00-0E
+		 *
+		 * Others reserved for future standardization
+		 */
+		switch (dest[5]) {
+		case 0x00:	/* Bridge Group Address */
+			/* If STP is turned off,
+			   then must forward to keep loop detection */
+			if (p->br->stp_enabled == BR_NO_STP)
+				goto forward;
+			break;
+
+		case 0x01:	/* IEEE MAC (Pause) */
 			goto drop;
 
-		/* If STP is turned off, then forward */
-		if (p->br->stp_enabled == BR_NO_STP && dest[5] == 0)
-			goto forward;
+		default:
+			/* Allow selective forwarding for most other protocols */
+			if (p->br->group_fwd_mask & (1u << dest[5]))
+				goto forward;
+		}
 
+		/* Deliver packet to local host only */
 		if (NF_HOOK(NFPROTO_BRIDGE, NF_BR_LOCAL_IN, skb, skb->dev,
 			    NULL, br_handle_local_finish)) {
 			return RX_HANDLER_CONSUMED; /* consumed by filter */
--- a/net/bridge/br_private.h	2011-10-03 11:08:32.888122106 -0700
+++ b/net/bridge/br_private.h	2011-10-03 11:18:22.967713859 -0700
@@ -29,6 +29,11 @@
 
 #define BR_VERSION	"2.3"
 
+/* Control of forwarding link local multicast */
+#define BR_GROUPFWD_DEFAULT	0
+/* Don't allow forwarding control protocols like STP and LLDP */
+#define BR_GROUPFWD_RESTRICTED	0x4007u
+
 /* Path to usermode spanning tree program */
 #define BR_STP_PROG	"/sbin/bridge-stp"
 
@@ -193,6 +198,8 @@ struct net_bridge
 	unsigned long			flags;
 #define BR_SET_MAC_ADDR		0x00000001
 
+	u16				group_fwd_mask;
+
 	/* STP */
 	bridge_id			designated_root;
 	bridge_id			bridge_id;
--- a/net/bridge/br_sysfs_br.c	2011-10-03 11:08:32.920122541 -0700
+++ b/net/bridge/br_sysfs_br.c	2011-10-03 11:08:43.932271613 -0700
@@ -149,6 +149,39 @@ static ssize_t store_stp_state(struct de
 static DEVICE_ATTR(stp_state, S_IRUGO | S_IWUSR, show_stp_state,
 		   store_stp_state);
 
+static ssize_t show_group_fwd_mask(struct device *d,
+			      struct device_attribute *attr, char *buf)
+{
+	struct net_bridge *br = to_bridge(d);
+	return sprintf(buf, "%#x\n", br->group_fwd_mask);
+}
+
+
+static ssize_t store_group_fwd_mask(struct device *d,
+			       struct device_attribute *attr, const char *buf,
+			       size_t len)
+{
+	struct net_bridge *br = to_bridge(d);
+	char *endp;
+	unsigned long val;
+
+	if (!capable(CAP_NET_ADMIN))
+		return -EPERM;
+
+	val = simple_strtoul(buf, &endp, 0);
+	if (endp == buf)
+		return -EINVAL;
+
+	if (val & BR_GROUPFWD_RESTRICTED)
+		return -EINVAL;
+
+	br->group_fwd_mask = val;
+
+	return len;
+}
+static DEVICE_ATTR(group_fwd_mask, S_IRUGO | S_IWUSR, show_group_fwd_mask,
+		   store_group_fwd_mask);
+
 static ssize_t show_priority(struct device *d, struct device_attribute *attr,
 			     char *buf)
 {
@@ -652,6 +685,7 @@ static struct attribute *bridge_attrs[]
 	&dev_attr_max_age.attr,
 	&dev_attr_ageing_time.attr,
 	&dev_attr_stp_state.attr,
+	&dev_attr_group_fwd_mask.attr,
 	&dev_attr_priority.attr,
 	&dev_attr_bridge_id.attr,
 	&dev_attr_root_id.attr,

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-04  4:14 ` [PATCH 2/2] bridge: allow forwarding some link local frames Stephen Hemminger
@ 2011-10-04 19:11   ` Benjamin Poirier
  2011-10-05 19:40   ` Ben Hutchings
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 34+ messages in thread
From: Benjamin Poirier @ 2011-10-04 19:11 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

On 11-10-03 21:14, Stephen Hemminger wrote:
> This is based on an earlier patch by Nick Carter with comments
> by David Lamparter but with some refinements. Thanks for their patience
> this is a confusing area with overlap of standards, user requirements,
> and compatibility with earlier releases.
> 
> It adds a new sysfs attribute 
>    /sys/class/net/brX/bridge/group_fwd_mask
> that controls forwarding of frames with address of: 01-80-C2-00-00-0X
> The default setting has no forwarding to retain compatibility.
> 
> One change from earlier releases is that forwarding of group
> addresses is not dependent on STP being enabled or disabled. This
> choice was made based on interpretation of tie 802.1 standards.
> I expect complaints will arise because of this, but better to follow
> the standard than continue acting incorrectly by default.
> 
> The filtering mask is writeable, but only values that don't forward
> known control frames are allowed. It intentionally blocks attempts
> to filter control protocols. For example: writing a 8 allows
> forwarding 802.1X PAE addresses which is the most common request.
> 

Indeed, I have tested this patch with kvm + tap + bridge to
authenticate/authorize a virtual machine connected to a 802.1X enabled
switch. It works swell.

Tested-by: Benjamin Poirier <benjamin.poirier@gmail.com>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-04  4:14 ` [PATCH 2/2] bridge: allow forwarding some link local frames Stephen Hemminger
  2011-10-04 19:11   ` Benjamin Poirier
@ 2011-10-05 19:40   ` Ben Hutchings
  2011-10-05 20:50     ` Stephen Hemminger
  2011-10-06 19:28   ` David Miller
  2011-10-17 14:35   ` Ed Swierk
  3 siblings, 1 reply; 34+ messages in thread
From: Ben Hutchings @ 2011-10-05 19:40 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

On Mon, 2011-10-03 at 21:14 -0700, Stephen Hemminger wrote:
> plain text document attachment (bridge-multicast-filter.patch)
> This is based on an earlier patch by Nick Carter with comments
> by David Lamparter but with some refinements. Thanks for their patience
> this is a confusing area with overlap of standards, user requirements,
> and compatibility with earlier releases.
> 
> It adds a new sysfs attribute 
>    /sys/class/net/brX/bridge/group_fwd_mask
> that controls forwarding of frames with address of: 01-80-C2-00-00-0X
> The default setting has no forwarding to retain compatibility.
> 
> One change from earlier releases is that forwarding of group
> addresses is not dependent on STP being enabled or disabled. This
> choice was made based on interpretation of tie 802.1 standards.
> I expect complaints will arise because of this, but better to follow
> the standard than continue acting incorrectly by default.
> 
> The filtering mask is writeable, but only values that don't forward
> known control frames are allowed. It intentionally blocks attempts
> to filter control protocols. For example: writing a 8 allows
> forwarding 802.1X PAE addresses which is the most common request.
[...]

I wonder why you don't forbid forwarding frames sent to reserved
destination addresses?  The standards seem pretty clear that this should
not be allowed.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-05 19:40   ` Ben Hutchings
@ 2011-10-05 20:50     ` Stephen Hemminger
  0 siblings, 0 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-10-05 20:50 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David S. Miller, netdev

On Wed, 05 Oct 2011 20:40:19 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> On Mon, 2011-10-03 at 21:14 -0700, Stephen Hemminger wrote:
> > plain text document attachment (bridge-multicast-filter.patch)
> > This is based on an earlier patch by Nick Carter with comments
> > by David Lamparter but with some refinements. Thanks for their patience
> > this is a confusing area with overlap of standards, user requirements,
> > and compatibility with earlier releases.
> > 
> > It adds a new sysfs attribute 
> >    /sys/class/net/brX/bridge/group_fwd_mask
> > that controls forwarding of frames with address of: 01-80-C2-00-00-0X
> > The default setting has no forwarding to retain compatibility.
> > 
> > One change from earlier releases is that forwarding of group
> > addresses is not dependent on STP being enabled or disabled. This
> > choice was made based on interpretation of tie 802.1 standards.
> > I expect complaints will arise because of this, but better to follow
> > the standard than continue acting incorrectly by default.
> > 
> > The filtering mask is writeable, but only values that don't forward
> > known control frames are allowed. It intentionally blocks attempts
> > to filter control protocols. For example: writing a 8 allows
> > forwarding 802.1X PAE addresses which is the most common request.
> [...]
> 
> I wonder why you don't forbid forwarding frames sent to reserved
> destination addresses?  The standards seem pretty clear that this should
> not be allowed.

Future proofing. Since addresses are unassigned there is no certainty of the
assigned semantics when they are used.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-10-04  4:14 ` [PATCH 1/2] bridge: leave carrier on for empty bridge Stephen Hemminger
@ 2011-10-06 19:28   ` David Miller
  0 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2011-10-06 19:28 UTC (permalink / raw)
  To: shemminger; +Cc: netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 03 Oct 2011 21:14:45 -0700

> This resolves a regression seen by some users of bridging.
> Some users use the bridge like a dummy device. 
> They expect to be able to put an IPv6 address on the device
> with no ports attached. Although there are better ways of doing
> this, there is no reason to not allow it.
> 
> Note: the bridge still will reflect the state of ports in the
> bridge if there are any added.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied to 'net' and queued up for -stable.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-04  4:14 ` [PATCH 2/2] bridge: allow forwarding some link local frames Stephen Hemminger
  2011-10-04 19:11   ` Benjamin Poirier
  2011-10-05 19:40   ` Ben Hutchings
@ 2011-10-06 19:28   ` David Miller
  2011-10-17 14:35   ` Ed Swierk
  3 siblings, 0 replies; 34+ messages in thread
From: David Miller @ 2011-10-06 19:28 UTC (permalink / raw)
  To: shemminger; +Cc: netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 03 Oct 2011 21:14:46 -0700

> This is based on an earlier patch by Nick Carter with comments
> by David Lamparter but with some refinements. Thanks for their patience
> this is a confusing area with overlap of standards, user requirements,
> and compatibility with earlier releases.
> 
> It adds a new sysfs attribute 
>    /sys/class/net/brX/bridge/group_fwd_mask
> that controls forwarding of frames with address of: 01-80-C2-00-00-0X
> The default setting has no forwarding to retain compatibility.
> 
> One change from earlier releases is that forwarding of group
> addresses is not dependent on STP being enabled or disabled. This
> choice was made based on interpretation of tie 802.1 standards.
> I expect complaints will arise because of this, but better to follow
> the standard than continue acting incorrectly by default.
> 
> The filtering mask is writeable, but only values that don't forward
> known control frames are allowed. It intentionally blocks attempts
> to filter control protocols. For example: writing a 8 allows
> forwarding 802.1X PAE addresses which is the most common request.
> 
> Reported-by: David Lamparter <equinox@diac24.net>
> Original-patch-by: Nick Carter <ncarter100@gmail.com>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied to net-next.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-04  4:14 ` [PATCH 2/2] bridge: allow forwarding some link local frames Stephen Hemminger
                     ` (2 preceding siblings ...)
  2011-10-06 19:28   ` David Miller
@ 2011-10-17 14:35   ` Ed Swierk
  2011-10-17 15:18     ` Stephen Hemminger
  2011-10-17 20:53     ` Ross Brattain
  3 siblings, 2 replies; 34+ messages in thread
From: Ed Swierk @ 2011-10-17 14:35 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

Why is forwarding LLDP (01-80-C2-00-00-0E) frames forbidden? I'm
testing LLDP in a virtual topology and need the bridge to forward
them.

If we're worried about standards, there is justification for allowing
forwarding of LLDP frames. 802.1d-2005 specifies two classes of
bridge, customer (C-VLAN) and provider (S-VLAN). Customer bridge is
just new terminology for what was previously just called an
802.1d-compliant bridge, while provider bridge is a new class that
transparently forwards certain control frames.

The only MAC addresses that are not supposed to be forwarded by either
customer or provider bridges are:

IEEE 802.3 Full Duplex PAUSE operation (01-80-C2-00-00-01)
IEEE 802.3 Slow_Protocols_Multicast address (01-80-C2-00-00-02)
IEEE 802.1X PAE address (01-80-C2-00-00-03)
Provider Bridge Group Address (01-80-C2-00-00-08)

Customer bridges are also not supposed to forward these addresses:

Bridge Group Address (01-80-C2-00-00-00)
Provider Bridge GVRP Address (01-80-C2-00-00-0D)
IEEE 802.1AB Link Layer Discovery Protocol multicast address (01-80-C2-00-00-0E)

My application requires a bridge between a pair of interfaces that
forwards (at least) LLDP frames; call this a provider bridge if you
care about standards conformance. It sounds like others require
forwarding 802.1X PAE frames, which appears non-conformant in any
case.

Standards aside, given that the default behavior is safe and that
/sys/class/net/brX/bridge/group_fwd_mask is unlikely to be modified by
accident by a casual user, can we just remove the
BR_GROUPFWD_RESTRICTED mask and allow users to forward whatever they
want?

--Ed

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-17 14:35   ` Ed Swierk
@ 2011-10-17 15:18     ` Stephen Hemminger
  2011-10-17 20:53     ` Ross Brattain
  1 sibling, 0 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-10-17 15:18 UTC (permalink / raw)
  To: Ed Swierk; +Cc: David S. Miller, netdev

On Mon, 17 Oct 2011 07:35:53 -0700
Ed Swierk <eswierk@bigswitch.com> wrote:

> Why is forwarding LLDP (01-80-C2-00-00-0E) frames forbidden? I'm
> testing LLDP in a virtual topology and need the bridge to forward
> them.
> 
> If we're worried about standards, there is justification for allowing
> forwarding of LLDP frames. 802.1d-2005 specifies two classes of
> bridge, customer (C-VLAN) and provider (S-VLAN). Customer bridge is
> just new terminology for what was previously just called an
> 802.1d-compliant bridge, while provider bridge is a new class that
> transparently forwards certain control frames.


Because in current 802.1Q (2005) standard there explicit language
that LLDP should not be forwarded. In Section 7.5

	Frames that carry control information to determine the active
	topology and current extent of each VLAN, i.e., spanning tree
	and GVRP BPDUs, and frames from other link constrained
	protocols, such as EAPOL and LLDP, are not forwarded.
	Permanently configured static entries in the filtering database
	(8.2, 8.3, and 8.12) ensure that such frames are discarded by
	the Forwarding Process (8.6).

> The only MAC addresses that are not supposed to be forwarded by either
> customer or provider bridges are:
> 
> IEEE 802.3 Full Duplex PAUSE operation (01-80-C2-00-00-01)
> IEEE 802.3 Slow_Protocols_Multicast address (01-80-C2-00-00-02)
> IEEE 802.1X PAE address (01-80-C2-00-00-03)
> Provider Bridge Group Address (01-80-C2-00-00-08)
>
> Customer bridges are also not supposed to forward these addresses:
> 
> Bridge Group Address (01-80-C2-00-00-00)
> Provider Bridge GVRP Address (01-80-C2-00-00-0D)
> IEEE 802.1AB Link Layer Discovery Protocol multicast address (01-80-C2-00-00-0E)
> 
> My application requires a bridge between a pair of interfaces that
> forwards (at least) LLDP frames; call this a provider bridge if you
> care about standards conformance. It sounds like others require
> forwarding 802.1X PAE frames, which appears non-conformant in any
> case.
> 
> Standards aside, given that the default behavior is safe and that
> /sys/class/net/brX/bridge/group_fwd_mask is unlikely to be modified by
> accident by a casual user, can we just remove the
> BR_GROUPFWD_RESTRICTED mask and allow users to forward whatever they

Since EAPOL is allowed, and there is a use case for LLDP, allowing
that is probably okay.

I would prefer not to let user break standards by default. You of course are
free to compile what ever you want

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-17 14:35   ` Ed Swierk
  2011-10-17 15:18     ` Stephen Hemminger
@ 2011-10-17 20:53     ` Ross Brattain
  2011-10-17 21:09       ` Ed Swierk
  1 sibling, 1 reply; 34+ messages in thread
From: Ross Brattain @ 2011-10-17 20:53 UTC (permalink / raw)
  To: Ed Swierk; +Cc: Stephen Hemminger, David S. Miller, netdev

On Mon, 17 Oct 2011 07:35:53 -0700
Ed Swierk <eswierk@bigswitch.com> wrote:

> Why is forwarding LLDP (01-80-C2-00-00-0E) frames forbidden? I'm
> testing LLDP in a virtual topology and need the bridge to forward
> them.
> 
> If we're worried about standards, there is justification for allowing
> forwarding of LLDP frames. 802.1d-2005 specifies two classes of
> bridge, customer (C-VLAN) and provider (S-VLAN). Customer bridge is
> just new terminology for what was previously just called an
> 802.1d-compliant bridge, while provider bridge is a new class that
> transparently forwards certain control frames.

01-80-C2-00-00-0E should not pass the physical link.  If it does it will affect PFC 802.1Qbb and ETS 802.1Qaz.

802.1AB-2009 is more specific.  See Table 7-1 Group MAC addresses used by LLDP:

Nearest bridge: 01-80-C2-00-00-0E
Propagation constrained to a single physical link; stopped by all types of bridge

Nearest non-TPMR bridge: 01-80-C2-00-00-03
Propagation constrained by all bridges other than TPMRs; intended for use within provider bridged networks

Nearest Customer Bridge: 01-80-C2-00-00-00
Propagation constrained by customer bridges; this gives the same coverage as a customer-customer MACSec connection


--
Ross

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-17 20:53     ` Ross Brattain
@ 2011-10-17 21:09       ` Ed Swierk
  2011-10-17 23:07         ` Ross Brattain
  0 siblings, 1 reply; 34+ messages in thread
From: Ed Swierk @ 2011-10-17 21:09 UTC (permalink / raw)
  To: Ross Brattain; +Cc: Stephen Hemminger, David S. Miller, netdev

Interesting, I didn't realize LLDP could use any of those addresses.

I finally got a peek at the hot-off-the-presses IEEE 802.1Q-2011, and
notice that 01-80-C2-00-00-0E is now assigned as "Individual LAN Scope
group address, Nearest bridge group address" rather than dedicated to
LLDP specifically.

Since our application is generating the LLDP frames we could change it
to use -00 or -03 and let the Linux bridge drop the -0E frames.

--Ed

On Mon, Oct 17, 2011 at 1:53 PM, Ross Brattain
<ross.b.brattain@intel.com> wrote:
> On Mon, 17 Oct 2011 07:35:53 -0700
> Ed Swierk <eswierk@bigswitch.com> wrote:
>
>> Why is forwarding LLDP (01-80-C2-00-00-0E) frames forbidden? I'm
>> testing LLDP in a virtual topology and need the bridge to forward
>> them.
>>
>> If we're worried about standards, there is justification for allowing
>> forwarding of LLDP frames. 802.1d-2005 specifies two classes of
>> bridge, customer (C-VLAN) and provider (S-VLAN). Customer bridge is
>> just new terminology for what was previously just called an
>> 802.1d-compliant bridge, while provider bridge is a new class that
>> transparently forwards certain control frames.
>
> 01-80-C2-00-00-0E should not pass the physical link.  If it does it will affect PFC 802.1Qbb and ETS 802.1Qaz.
>
> 802.1AB-2009 is more specific.  See Table 7-1 Group MAC addresses used by LLDP:
>
> Nearest bridge: 01-80-C2-00-00-0E
> Propagation constrained to a single physical link; stopped by all types of bridge
>
> Nearest non-TPMR bridge: 01-80-C2-00-00-03
> Propagation constrained by all bridges other than TPMRs; intended for use within provider bridged networks
>
> Nearest Customer Bridge: 01-80-C2-00-00-00
> Propagation constrained by customer bridges; this gives the same coverage as a customer-customer MACSec connection
>
>
> --
> Ross
>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-17 21:09       ` Ed Swierk
@ 2011-10-17 23:07         ` Ross Brattain
  2011-10-17 23:36           ` Ed Swierk
  0 siblings, 1 reply; 34+ messages in thread
From: Ross Brattain @ 2011-10-17 23:07 UTC (permalink / raw)
  To: Ed Swierk; +Cc: Stephen Hemminger, David S. Miller, netdev

On Mon, 17 Oct 2011 14:09:34 -0700
Ed Swierk <eswierk@bigswitch.com> wrote:

> Interesting, I didn't realize LLDP could use any of those addresses.
> 
> I finally got a peek at the hot-off-the-presses IEEE 802.1Q-2011, and
> notice that 01-80-C2-00-00-0E is now assigned as "Individual LAN Scope
> group address, Nearest bridge group address" rather than dedicated to
> LLDP specifically.
> 

802.1AB-2009  Section 7.1 Destination address:

NOTE 8—The destination MAC address used by a given LLDP agent defines only the scope of transmission and the
intended recipient(s) of the LLDPDUs; it plays no part in protocol identification. In particular, the group MAC addresses
identified in Table 7-1 are not used exclusively by LLDP; other protocols that require to use a similar transmission scope
are free to use the same addresses.

> Since our application is generating the LLDP frames we could change it
> to use -00 or -03 and let the Linux bridge drop the -0E frames.
> 

If you control both end stations you could use the optional group MAC address support, or unicast LLDP.

802.1AB-2009  Section 7.1 Destination address:

In addition to the prescribed support for standard group MAC addresses shown in Table 7-1,
implementations of LLDP may support the following destination addresses for LLDPDUs:
d) Any group MAC address.
e) Any individual MAC address.
Support for the use of each of these destination addresses, for both transmission and reception of LLDPDUs,
is either mandatory, recommended, permitted, or not permitted, according to the type of system in which
LLDP is implemented, as shown in Table 7-2.

I have no idea if any LLDP agents support the optional group MAC addresses.

--
Ross

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-17 23:07         ` Ross Brattain
@ 2011-10-17 23:36           ` Ed Swierk
  2011-10-18  0:00             ` John Fastabend
  0 siblings, 1 reply; 34+ messages in thread
From: Ed Swierk @ 2011-10-17 23:36 UTC (permalink / raw)
  To: Ross Brattain; +Cc: Stephen Hemminger, David S. Miller, netdev

On Mon, Oct 17, 2011 at 4:07 PM, Ross Brattain
<ross.b.brattain@intel.com> wrote:
> 802.1AB-2009  Section 7.1 Destination address:
>
> NOTE 8—The destination MAC address used by a given LLDP agent defines only the scope of transmission and the
> intended recipient(s) of the LLDPDUs; it plays no part in protocol identification. In particular, the group MAC addresses
> identified in Table 7-1 are not used exclusively by LLDP; other protocols that require to use a similar transmission scope
> are free to use the same addresses.
> ...
> If you control both end stations you could use the optional group MAC address support, or unicast LLDP.
>
> 802.1AB-2009  Section 7.1 Destination address:
>
> In addition to the prescribed support for standard group MAC addresses shown in Table 7-1,
> implementations of LLDP may support the following destination addresses for LLDPDUs:
> d) Any group MAC address.
> e) Any individual MAC address.
> Support for the use of each of these destination addresses, for both transmission and reception of LLDPDUs,
> is either mandatory, recommended, permitted, or not permitted, according to the type of system in which
> LLDP is implemented, as shown in Table 7-2.

Thanks for the references. I need to read the updated standards specs
before jumping to conclusions...

> I have no idea if any LLDP agents support the optional group MAC addresses.

In our application we're both generating and consuming the LLDP
frames. We're worried about standards conformance to the extent that
we don't break other tools that might receive the LLDP frames we
generate. As long as they don't care about the destination MAC address
of the frames they receive (and they shouldn't), it's definitely
feasible for us to use the "nearest customer bridge" address
(01-80-C2-00-00-00) to ensure our LLDP frames traverse Linux bridges.

--Ed

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 2/2] bridge: allow forwarding some link local frames
  2011-10-17 23:36           ` Ed Swierk
@ 2011-10-18  0:00             ` John Fastabend
  0 siblings, 0 replies; 34+ messages in thread
From: John Fastabend @ 2011-10-18  0:00 UTC (permalink / raw)
  To: Ed Swierk; +Cc: Brattain, Ross B, Stephen Hemminger, David S. Miller, netdev

On 10/17/2011 4:36 PM, Ed Swierk wrote:
> On Mon, Oct 17, 2011 at 4:07 PM, Ross Brattain
> <ross.b.brattain@intel.com> wrote:
>> 802.1AB-2009  Section 7.1 Destination address:
>>
>> NOTE 8—The destination MAC address used by a given LLDP agent defines only the scope of transmission and the
>> intended recipient(s) of the LLDPDUs; it plays no part in protocol identification. In particular, the group MAC addresses
>> identified in Table 7-1 are not used exclusively by LLDP; other protocols that require to use a similar transmission scope
>> are free to use the same addresses.
>> ...
>> If you control both end stations you could use the optional group MAC address support, or unicast LLDP.
>>
>> 802.1AB-2009  Section 7.1 Destination address:
>>
>> In addition to the prescribed support for standard group MAC addresses shown in Table 7-1,
>> implementations of LLDP may support the following destination addresses for LLDPDUs:
>> d) Any group MAC address.
>> e) Any individual MAC address.
>> Support for the use of each of these destination addresses, for both transmission and reception of LLDPDUs,
>> is either mandatory, recommended, permitted, or not permitted, according to the type of system in which
>> LLDP is implemented, as shown in Table 7-2.
> 
> Thanks for the references. I need to read the updated standards specs
> before jumping to conclusions...
> 
>> I have no idea if any LLDP agents support the optional group MAC addresses.
> 
> In our application we're both generating and consuming the LLDP
> frames. We're worried about standards conformance to the extent that
> we don't break other tools that might receive the LLDP frames we
> generate. As long as they don't care about the destination MAC address
> of the frames they receive (and they shouldn't), it's definitely
> feasible for us to use the "nearest customer bridge" address
> (01-80-C2-00-00-00) to ensure our LLDP frames traverse Linux bridges.
> 
> --Ed

Ed,

Its unclear what you mean by "and they shouldn't". If the other tool
is an LLDP daemon then it will receive the frame and process it as
a nearest customer bridge LLDPDU.

However it looks like your on the right track here. If your adding
a standard TLV you might consider adding support to an existing
agent. For example 'lldpad'.

Thanks,
John.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-25  9:16                     ` Marc Haber
@ 2011-09-25 20:10                       ` Nicolas de Pesloüan
  0 siblings, 0 replies; 34+ messages in thread
From: Nicolas de Pesloüan @ 2011-09-25 20:10 UTC (permalink / raw)
  To: Marc Haber; +Cc: netdev

Le 25/09/2011 11:16, Marc Haber a écrit :
> On Tue, Sep 06, 2011 at 08:52:15AM +0200, Nicolas de Pesloüan wrote:
>> I really support the idea to keep the current behavior (assert
>> carrier on br0 when at least one port have carrier) and to fix the
>> applications to wait for the IPv6 address to be checked (DAD)
>> instead of dying on bind() failure.
>
> A really brilliant idea. Break things and then expect hundreds of apps
> or millions of installations to adapt.

Well... Considering the noise you made recently about the new bridge behavior, I'm sure we all 
understand this is a problem for you.

We try and find a reasonable solution between two somewhat incompatible expectations and this is not 
easy. If you have had a real reading of my proposal, you would have noticed that I really tried to 
find a solution that would be acceptable for both situations. Stephen, which is far more experienced 
than me on this topic explained that my proposal was (and still is) not applicable.

Instead of annoying us with comments like "brilliant idea" or "nice idea", feel free to propose 
something that would contribute to the solution.

	Nicolas.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-06  6:52                   ` Nicolas de Pesloüan
@ 2011-09-25  9:16                     ` Marc Haber
  2011-09-25 20:10                       ` Nicolas de Pesloüan
  0 siblings, 1 reply; 34+ messages in thread
From: Marc Haber @ 2011-09-25  9:16 UTC (permalink / raw)
  To: netdev

On Tue, Sep 06, 2011 at 08:52:15AM +0200, Nicolas de Pesloüan wrote:
> I really support the idea to keep the current behavior (assert
> carrier on br0 when at least one port have carrier) and to fix the
> applications to wait for the IPv6 address to be checked (DAD)
> instead of dying on bind() failure.

A really brilliant idea. Break things and then expect hundreds of apps
or millions of installations to adapt.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-04  7:35           ` Nicolas de Pesloüan
  2011-09-04 16:36             ` Stephen Hemminger
@ 2011-09-25  9:05             ` Marc Haber
  1 sibling, 0 replies; 34+ messages in thread
From: Marc Haber @ 2011-09-25  9:05 UTC (permalink / raw)
  To: netdev

On Sun, Sep 04, 2011 at 09:35:10AM +0200, Nicolas de Pesloüan wrote:
> - for those using bridge without any port, manually setting the IP
> will assert carrier on. (By the way, why don't they use a dummy
> device instead?)

Because there is no documentation or recommendation how to use things.
Being a networking guy, I have always treated a bridge as kind of a
switch, where it is natural to say "vlan 120, ip address a.b.c.d". I
just did the same with br0 on all my virtualization hosts, which used
to work until just recently.

Additionally, most distributions' init mechanisms are not very good in
handling dependencies between network interfaces, so writing stuff
like "configure br0, configure dummy0, add dummy0 to br0, wait for
things to settle, start daemons, start VMs" requires tweaking.

Is it recommended to actually have radvd and/or dhcpd listen on the
dummy interface wich is member of a bridge instead of the bridge itself?

> - for those using bridge with ports:
> -- Using any kind of autoconfig will work as expected. Carrier will
> only be asserted at the time first port get carrier.

This only holds when the host with the bridge is the network client,
and only if rdnssd is not used. If the host with the bridge is
supposed to run radvd and/or dhcpd, it is desired to have those
services running before the first port gets attached to the bridge
(which may be hours after the system boot in the desktop
virtualization case).

> -- Using static IP confifiguration, carrier will possibly be
> erroneously reported as on during the small time gap between IP
> address configuration and first port is added to the bridge. This
> time gap may be removed by simply configuring the IP after the first
> port is added. This is probably already true for most distribs. And
> anyway, this time gap is probably not a problem.

You're assuming that the first port gets added immediately after the
port was created. This is not the case, Virtualbox only creates the
vboxnet interface that gets added to the bridge when the VM is
started, which may be a manual operation done by the user at the time
she actually needs the VM.

> -- Carrier will also be erroneously reported as on after removing
> the last port, if the bridge still has an IP.

For my use cases, this is the desired behavior.

>  (But we can arrange for this not to happen).

Please not.

> And in order to ensure user really understand why carrier is on of
> off, we can simply issue an INFO message for the non-natural case
> (bridge_has_no_port & bridga_has_at_least_one_ip).

I fail to understand why this is the non-natural case.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-03  2:15       ` Ang Way Chuang
  2011-09-03  6:30         ` Stephen Hemminger
@ 2011-09-25  8:55         ` Marc Haber
  1 sibling, 0 replies; 34+ messages in thread
From: Marc Haber @ 2011-09-25  8:55 UTC (permalink / raw)
  To: netdev

On Sat, Sep 03, 2011 at 11:15:41AM +0900, Ang Way Chuang wrote:
> A more ideal solution in this case is to add the option to enabling
> carrier on sysfs and modify libvirtd to turn on the carrier if IPv6 is
> enabled.

I would even do it manually from an init script if that saves me from
having an extra dummy interface on a bridge just to force it up.

>  Since there is no other
>  complain from other user with this setup, I guess nobody actually
>  assigns IPv6 to libvirtd network device at this moment

I do. Daily. And get bitten every time I reboot. A _major_ nuisance.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 3221 2323190

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-05 17:57                 ` Stephen Hemminger
  2011-09-05 19:02                   ` Ang Way Chuang
@ 2011-09-06  6:52                   ` Nicolas de Pesloüan
  2011-09-25  9:16                     ` Marc Haber
  1 sibling, 1 reply; 34+ messages in thread
From: Nicolas de Pesloüan @ 2011-09-06  6:52 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

Le 05/09/2011 19:57, Stephen Hemminger a écrit :
> The root cause of the problem is applications that don't deal with unresolved
> IPv6 addresses. I already had to solve this in our distribution for NTP in a
> not bridge related problem. It is better to fix the applications to understand
> IPv6 address semantics than to try and force bridge to behave in a way that
> is friendly to these applications.

Thanks for clarifying.

> The earlier mail said it is a problem with dnsmasq and radvd. Let's work on understanding
> if they need to be updated before jumping in with hacks to the bridge code.
>

I really support the idea to keep the current behavior (assert carrier on br0 when at least one port 
have carrier) and to fix the applications to wait for the IPv6 address to be checked (DAD) instead 
of dying on bind() failure.

Thanks.

	Nicolas.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-05 19:02                   ` Ang Way Chuang
@ 2011-09-05 22:45                     ` Stephen Hemminger
  0 siblings, 0 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-09-05 22:45 UTC (permalink / raw)
  To: Ang Way Chuang; +Cc: Nicolas de Pesloüan, David S. Miller, netdev

On Tue, 06 Sep 2011 04:02:12 +0900
Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:

> On 06/09/11 02:57, Stephen Hemminger wrote:
> > The root cause of the problem is applications that don't deal with unresolved
> > IPv6 addresses. I already had to solve this in our distribution for NTP in a
> > not bridge related problem. It is better to fix the applications to understand
> > IPv6 address semantics than to try and force bridge to behave in a way that
> > is friendly to these applications.
> Care to share the patch that you did for NTP? Perhaps, I may apply the same trick and tried it out on dnsmasq and radvd if I have time.

It has been submitted upstream, but probably an eternity until
it ever gets merged through the NTP project...

The problem happens on our system because NTP runs before interfaces
brought up.



commit 0997ebe40b2835a58ba2ea1e504e38d6d29c95ed
Author: Stephen Hemminger <stephen.hemminger@vyatta.com>
Date:   Tue Oct 26 17:55:04 2010 -0700

    Ignore IPV6 Dynamic addresses
    
    During boot link-local addresses are generated dynamically.
    These addresses are in a tentative state until after resolution occurs.
    While in the tentative state, the address can not be bound to.
    NTP daemon will see the address become available later when it rescans.
    
    (revised patch for 4.2.4p6)

diff --git a/lib/isc/unix/interfaceiter.c b/lib/isc/unix/interfaceiter.c
index 87af69e..64a9f4f 100644
--- a/lib/isc/unix/interfaceiter.c
+++ b/lib/isc/unix/interfaceiter.c
@@ -151,6 +151,7 @@ get_addr(unsigned int family, isc_netaddr_t *dst, struct sockaddr *src,
 static isc_result_t linux_if_inet6_next(isc_interfaceiter_t *);
 static isc_result_t linux_if_inet6_current(isc_interfaceiter_t *);
 static void linux_if_inet6_first(isc_interfaceiter_t *iter);
+#include <linux/if_addr.h>
 #endif
 
 #if HAVE_GETIFADDRS
@@ -216,6 +217,11 @@ linux_if_inet6_current(isc_interfaceiter_t *iter) {
 			      "/proc/net/if_inet6:strlen(%s) != 32", address);
 		return (ISC_R_FAILURE);
 	}
+#ifdef __linux
+	/* Ignore DAD addresses -- can't bind to them till resolved */
+	if (flags & IFA_F_TENTATIVE)
+		return (ISC_R_IGNORE);
+#endif
 	for (i = 0; i < 16; i++) {
 		unsigned char byte;
 		static const char hex[] = "0123456789abcdef";

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-05 17:57                 ` Stephen Hemminger
@ 2011-09-05 19:02                   ` Ang Way Chuang
  2011-09-05 22:45                     ` Stephen Hemminger
  2011-09-06  6:52                   ` Nicolas de Pesloüan
  1 sibling, 1 reply; 34+ messages in thread
From: Ang Way Chuang @ 2011-09-05 19:02 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Nicolas de Pesloüan, David S. Miller, netdev

On 06/09/11 02:57, Stephen Hemminger wrote:
> The root cause of the problem is applications that don't deal with unresolved
> IPv6 addresses. I already had to solve this in our distribution for NTP in a
> not bridge related problem. It is better to fix the applications to understand
> IPv6 address semantics than to try and force bridge to behave in a way that
> is friendly to these applications.
Care to share the patch that you did for NTP? Perhaps, I may apply the same trick and tried it out on dnsmasq and radvd if I have time.
Thanks.
>
> The earlier mail said it is a problem with dnsmasq and radvd. Let's work on understanding
> if they need to be updated before jumping in with hacks to the bridge code.
> --
> 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
>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-05 17:18               ` Nicolas de Pesloüan
@ 2011-09-05 17:57                 ` Stephen Hemminger
  2011-09-05 19:02                   ` Ang Way Chuang
  2011-09-06  6:52                   ` Nicolas de Pesloüan
  0 siblings, 2 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-09-05 17:57 UTC (permalink / raw)
  To: Nicolas de Pesloüan; +Cc: David S. Miller, netdev

The root cause of the problem is applications that don't deal with unresolved
IPv6 addresses. I already had to solve this in our distribution for NTP in a
not bridge related problem. It is better to fix the applications to understand
IPv6 address semantics than to try and force bridge to behave in a way that
is friendly to these applications.

The earlier mail said it is a problem with dnsmasq and radvd. Let's work on understanding
if they need to be updated before jumping in with hacks to the bridge code.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-04 16:36             ` Stephen Hemminger
  2011-09-04 17:12               ` Krzysztof Olędzki
@ 2011-09-05 17:18               ` Nicolas de Pesloüan
  2011-09-05 17:57                 ` Stephen Hemminger
  1 sibling, 1 reply; 34+ messages in thread
From: Nicolas de Pesloüan @ 2011-09-05 17:18 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

Le 04/09/2011 18:36, Stephen Hemminger a écrit :
> On Sun, 04 Sep 2011 09:35:10 +0200
> Nicolas de Pesloüan<nicolas.2p.debian@gmail.com>  wrote:
>
>> Le 04/09/2011 06:14, Stephen Hemminger a écrit :
>>
>>>> Instead of asserting carrier when the bridge have no port, can't we assert carrier when the three
>>>> following condition are true at the same time :
>>>>
>>>> - The bridge have no port.
>>>> - At least one IP address is setup on the bridge.
>>>> - The two above conditions are true for more than a configurable amount of seconds, with a default
>>>> of 10, for example.
>>>>
>>>> This would only delay carrier on for a few seconds for the regression and keep the current behavior
>>>> (carrier off until at least 1 port is on) for DHCP.
>>>
>>> This fails on two counts:
>>> 1. Bridge's often run without IP addresses!
>>> 2. DHCP won't try and send out request until carrier is true.
>>
>> Sorry, I missed to say that we should of course also assert carrier on if one port has carrier on.
>>
>> And rethinking about it, the delay is probably useless :
>>
>> bridge_carrier_on = at_least_one_port_has_carrier_on | (bridge_has_no_port&  bridge_has_at_least_one_ip)
>>
>> That way :
>> - for those using bridge without any port, manually setting the IP will assert carrier on. (By the
>> way, why don't they use a dummy device instead?)
>>
>> - for those using bridge with ports:
>> -- Using any kind of autoconfig will work as expected. Carrier will only be asserted at the time
>> first port get carrier.
>> -- Using static IP confifiguration, carrier will possibly be erroneously reported as on during the
>> small time gap between IP address configuration and first port is added to the bridge. This time gap
>> may be removed by simply configuring the IP after the first port is added. This is probably already
>> true for most distribs. And anyway, this time gap is probably not a problem.
>> -- Carrier will also be erroneously reported as on after removing the last port, if the bridge still
>> has an IP. (But we can arrange for this not to happen).
>>
>> And in order to ensure user really understand why carrier is on of off, we can simply issue an INFO
>> message for the non-natural case (bridge_has_no_port&  bridga_has_at_least_one_ip).
>>
>> I consider all this reasonable.
>>
>> 	Nicolas.
>
> Any bridge behaviour based on IP address configuration is a
> layering violation and won't work.  The problem is related to dynamic issues
> with IPv6 and DHCP and needs to be addressed at that level.

Well, this is not a bridge behavior, this is a behavior of the local (non physical) interface of the 
bridge. If this interface were physical, it would have been external to the bridge (on one of the 
hosts connected to the bridge).  As such, this behavior is not related to the layering of the 
bridge, so I don't consider it a layering violation.

My proposed change doesn't impact the way the bridge works (forwards packets) in any way.

And it really solves both issues.

	Nicolas.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-04 17:12               ` Krzysztof Olędzki
@ 2011-09-05  4:51                 ` Ang Way Chuang
  0 siblings, 0 replies; 34+ messages in thread
From: Ang Way Chuang @ 2011-09-05  4:51 UTC (permalink / raw)
  To: Krzysztof Olędzki
  Cc: Stephen Hemminger, Nicolas de Pesloüan, David S. Miller,
	netdev, Achmad Basuki

On 05/09/11 02:12, Krzysztof Olędzki wrote:
> On 2011-09-04 18:36, Stephen Hemminger wrote:
>> On Sun, 04 Sep 2011 09:35:10 +0200
>> Nicolas de Pesloüan<nicolas.2p.debian@gmail.com>  wrote:
>>
>>> Le 04/09/2011 06:14, Stephen Hemminger a écrit :
>>>
>>>>> Instead of asserting carrier when the bridge have no port, can't we assert carrier when the three
>>>>> following condition are true at the same time :
>>>>>
>>>>> - The bridge have no port.
>>>>> - At least one IP address is setup on the bridge.
>>>>> - The two above conditions are true for more than a configurable amount of seconds, with a default
>>>>> of 10, for example.
>>>>>
>>>>> This would only delay carrier on for a few seconds for the regression and keep the current behavior
>>>>> (carrier off until at least 1 port is on) for DHCP.
>>>>
>>>> This fails on two counts:
>>>> 1. Bridge's often run without IP addresses!
>>>> 2. DHCP won't try and send out request until carrier is true.
>>>
>>> Sorry, I missed to say that we should of course also assert carrier on if one port has carrier on.
>>>
>>> And rethinking about it, the delay is probably useless :
>>>
>>> bridge_carrier_on = at_least_one_port_has_carrier_on | (bridge_has_no_port&  bridge_has_at_least_one_ip)
>>>
>>> That way :
>>> - for those using bridge without any port, manually setting the IP will assert carrier on. (By the
>>> way, why don't they use a dummy device instead?)
>>>
>>> - for those using bridge with ports:
>>> -- Using any kind of autoconfig will work as expected. Carrier will only be asserted at the time
>>> first port get carrier.
>>> -- Using static IP confifiguration, carrier will possibly be erroneously reported as on during the
>>> small time gap between IP address configuration and first port is added to the bridge. This time gap
>>> may be removed by simply configuring the IP after the first port is added. This is probably already
>>> true for most distribs. And anyway, this time gap is probably not a problem.
>>> -- Carrier will also be erroneously reported as on after removing the last port, if the bridge still
>>> has an IP. (But we can arrange for this not to happen).
>>>
>>> And in order to ensure user really understand why carrier is on of off, we can simply issue an INFO
>>> message for the non-natural case (bridge_has_no_port&  bridga_has_at_least_one_ip).
>>>
>>> I consider all this reasonable.
>>>
>>>     Nicolas.
>>
>> Any bridge behaviour based on IP address configuration is a
>> layering violation and won't work.  The problem is related to dynamic issues
>> with IPv6 and DHCP and needs to be addressed at that level.
>
> Maybe we can simply add a switch controlling if a bridge with no attached ports has carrier off (default) or on.
>
> For example:
>  echo {0|1} > /sys/devices/virtual/net/brX/bridge/orphaned_carrier
>
>  brctl orphaned_carrier brX {on|off}
>
> Best regards,
>
>                 Krzysztof Olędzki
My colleague investigated the problem. In the case of libvirt, there are 2 issues at hand:
- dnsmasq cannot bind to port 53 for IPv6 address, therefore fails.
- radvd fails to start because the interface is treated as being down.

This blog entry from Daniel Berrange explains the configuration used by libvirt:
http://berrange.com/posts/2011/06/16/providing-ipv6-connectivity-to-virtual-guests-with-libvirt-and-kvm/
It's quite possible that other users may have the same problem in the future if they plan to use radvd or
dnsmasq on a bridge interface. I'm not sure if there are other applications that depend on the carrier on
a bridge interface to function properly. Come to think of it, unless the user is aware of the change
in carrier on the bridge interface, it is very hard for them to diagnose the problem and apply the right
solution (toggling the carrier). Ideally, there is no reason why dnsmasq and radvd should be started if
there is no port attached to a bridge interface. But, we cannot assume that's how it is done.

I think that it is prudent that the whole commit should be reverted because the problem may not be limited
to libvirt use case.
>
> -- 
> 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
>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-04 16:36             ` Stephen Hemminger
@ 2011-09-04 17:12               ` Krzysztof Olędzki
  2011-09-05  4:51                 ` Ang Way Chuang
  2011-09-05 17:18               ` Nicolas de Pesloüan
  1 sibling, 1 reply; 34+ messages in thread
From: Krzysztof Olędzki @ 2011-09-04 17:12 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Nicolas de Pesloüan, David S. Miller, netdev

On 2011-09-04 18:36, Stephen Hemminger wrote:
> On Sun, 04 Sep 2011 09:35:10 +0200
> Nicolas de Pesloüan<nicolas.2p.debian@gmail.com>  wrote:
>
>> Le 04/09/2011 06:14, Stephen Hemminger a écrit :
>>
>>>> Instead of asserting carrier when the bridge have no port, can't we assert carrier when the three
>>>> following condition are true at the same time :
>>>>
>>>> - The bridge have no port.
>>>> - At least one IP address is setup on the bridge.
>>>> - The two above conditions are true for more than a configurable amount of seconds, with a default
>>>> of 10, for example.
>>>>
>>>> This would only delay carrier on for a few seconds for the regression and keep the current behavior
>>>> (carrier off until at least 1 port is on) for DHCP.
>>>
>>> This fails on two counts:
>>> 1. Bridge's often run without IP addresses!
>>> 2. DHCP won't try and send out request until carrier is true.
>>
>> Sorry, I missed to say that we should of course also assert carrier on if one port has carrier on.
>>
>> And rethinking about it, the delay is probably useless :
>>
>> bridge_carrier_on = at_least_one_port_has_carrier_on | (bridge_has_no_port&  bridge_has_at_least_one_ip)
>>
>> That way :
>> - for those using bridge without any port, manually setting the IP will assert carrier on. (By the
>> way, why don't they use a dummy device instead?)
>>
>> - for those using bridge with ports:
>> -- Using any kind of autoconfig will work as expected. Carrier will only be asserted at the time
>> first port get carrier.
>> -- Using static IP confifiguration, carrier will possibly be erroneously reported as on during the
>> small time gap between IP address configuration and first port is added to the bridge. This time gap
>> may be removed by simply configuring the IP after the first port is added. This is probably already
>> true for most distribs. And anyway, this time gap is probably not a problem.
>> -- Carrier will also be erroneously reported as on after removing the last port, if the bridge still
>> has an IP. (But we can arrange for this not to happen).
>>
>> And in order to ensure user really understand why carrier is on of off, we can simply issue an INFO
>> message for the non-natural case (bridge_has_no_port&  bridga_has_at_least_one_ip).
>>
>> I consider all this reasonable.
>>
>> 	Nicolas.
>
> Any bridge behaviour based on IP address configuration is a
> layering violation and won't work.  The problem is related to dynamic issues
> with IPv6 and DHCP and needs to be addressed at that level.

Maybe we can simply add a switch controlling if a bridge with no 
attached ports has carrier off (default) or on.

For example:
  echo {0|1} > /sys/devices/virtual/net/brX/bridge/orphaned_carrier

  brctl orphaned_carrier brX {on|off}

Best regards,

				Krzysztof Olędzki

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-04  7:35           ` Nicolas de Pesloüan
@ 2011-09-04 16:36             ` Stephen Hemminger
  2011-09-04 17:12               ` Krzysztof Olędzki
  2011-09-05 17:18               ` Nicolas de Pesloüan
  2011-09-25  9:05             ` Marc Haber
  1 sibling, 2 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-09-04 16:36 UTC (permalink / raw)
  To: Nicolas de Pesloüan; +Cc: David S. Miller, netdev

On Sun, 04 Sep 2011 09:35:10 +0200
Nicolas de Pesloüan <nicolas.2p.debian@gmail.com> wrote:

> Le 04/09/2011 06:14, Stephen Hemminger a écrit :
> 
> >> Instead of asserting carrier when the bridge have no port, can't we assert carrier when the three
> >> following condition are true at the same time :
> >>
> >> - The bridge have no port.
> >> - At least one IP address is setup on the bridge.
> >> - The two above conditions are true for more than a configurable amount of seconds, with a default
> >> of 10, for example.
> >>
> >> This would only delay carrier on for a few seconds for the regression and keep the current behavior
> >> (carrier off until at least 1 port is on) for DHCP.
> >
> > This fails on two counts:
> > 1. Bridge's often run without IP addresses!
> > 2. DHCP won't try and send out request until carrier is true.
> 
> Sorry, I missed to say that we should of course also assert carrier on if one port has carrier on.
> 
> And rethinking about it, the delay is probably useless :
> 
> bridge_carrier_on = at_least_one_port_has_carrier_on | (bridge_has_no_port & bridge_has_at_least_one_ip)
> 
> That way :
> - for those using bridge without any port, manually setting the IP will assert carrier on. (By the 
> way, why don't they use a dummy device instead?)
> 
> - for those using bridge with ports:
> -- Using any kind of autoconfig will work as expected. Carrier will only be asserted at the time 
> first port get carrier.
> -- Using static IP confifiguration, carrier will possibly be erroneously reported as on during the 
> small time gap between IP address configuration and first port is added to the bridge. This time gap 
> may be removed by simply configuring the IP after the first port is added. This is probably already 
> true for most distribs. And anyway, this time gap is probably not a problem.
> -- Carrier will also be erroneously reported as on after removing the last port, if the bridge still 
> has an IP. (But we can arrange for this not to happen).
> 
> And in order to ensure user really understand why carrier is on of off, we can simply issue an INFO 
> message for the non-natural case (bridge_has_no_port & bridga_has_at_least_one_ip).
> 
> I consider all this reasonable.
> 
> 	Nicolas.

Any bridge behaviour based on IP address configuration is a
layering violation and won't work.  The problem is related to dynamic issues
with IPv6 and DHCP and needs to be addressed at that level.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-04  4:14         ` Stephen Hemminger
@ 2011-09-04  7:35           ` Nicolas de Pesloüan
  2011-09-04 16:36             ` Stephen Hemminger
  2011-09-25  9:05             ` Marc Haber
  0 siblings, 2 replies; 34+ messages in thread
From: Nicolas de Pesloüan @ 2011-09-04  7:35 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

Le 04/09/2011 06:14, Stephen Hemminger a écrit :

>> Instead of asserting carrier when the bridge have no port, can't we assert carrier when the three
>> following condition are true at the same time :
>>
>> - The bridge have no port.
>> - At least one IP address is setup on the bridge.
>> - The two above conditions are true for more than a configurable amount of seconds, with a default
>> of 10, for example.
>>
>> This would only delay carrier on for a few seconds for the regression and keep the current behavior
>> (carrier off until at least 1 port is on) for DHCP.
>
> This fails on two counts:
> 1. Bridge's often run without IP addresses!
> 2. DHCP won't try and send out request until carrier is true.

Sorry, I missed to say that we should of course also assert carrier on if one port has carrier on.

And rethinking about it, the delay is probably useless :

bridge_carrier_on = at_least_one_port_has_carrier_on | (bridge_has_no_port & bridge_has_at_least_one_ip)

That way :
- for those using bridge without any port, manually setting the IP will assert carrier on. (By the 
way, why don't they use a dummy device instead?)

- for those using bridge with ports:
-- Using any kind of autoconfig will work as expected. Carrier will only be asserted at the time 
first port get carrier.
-- Using static IP confifiguration, carrier will possibly be erroneously reported as on during the 
small time gap between IP address configuration and first port is added to the bridge. This time gap 
may be removed by simply configuring the IP after the first port is added. This is probably already 
true for most distribs. And anyway, this time gap is probably not a problem.
-- Carrier will also be erroneously reported as on after removing the last port, if the bridge still 
has an IP. (But we can arrange for this not to happen).

And in order to ensure user really understand why carrier is on of off, we can simply issue an INFO 
message for the non-natural case (bridge_has_no_port & bridga_has_at_least_one_ip).

I consider all this reasonable.

	Nicolas.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-03 18:32       ` Nicolas de Pesloüan
@ 2011-09-04  4:14         ` Stephen Hemminger
  2011-09-04  7:35           ` Nicolas de Pesloüan
  0 siblings, 1 reply; 34+ messages in thread
From: Stephen Hemminger @ 2011-09-04  4:14 UTC (permalink / raw)
  To: Nicolas de Pesloüan; +Cc: David S. Miller, netdev

On Sat, 03 Sep 2011 20:32:28 +0200
Nicolas de Pesloüan <nicolas.2p.debian@gmail.com> wrote:

> Le 03/09/2011 00:11, Stephen Hemminger a écrit :
> > On Fri, 02 Sep 2011 23:39:03 +0200
> > Nicolas de Pesloüan<nicolas.2p.debian@gmail.com>  wrote:
> >
> >> Le 02/09/2011 19:22, Stephen Hemminger a écrit :
> >>> This resolves a regression seen by some users of bridging.
> >>> Some users use the bridge like a dummy device.
> >>> They expect to be able to put an IPv6 address on the device
> >>> with no ports attached during boot.
> >>>
> >>> Note: the bridge still will reflect the state of ports in the
> >>> bridge if there are any added.
> >>
> >> Doesn't this jeopardize the behavior introduced in 1faa4356a3bd89ea11fb92752d897cff3a20ec0e
> >> "bridge: control carrier based on ports online"?
> >>
> >> If the user starts the DHCP client before adding the first port to the bridge, the DHCP client will
> >> have a carrier and start the autoconfiguration process. This was the old behavior, but you fixed it.
> >>
> >> 	Nicolas.
> >>
> >
> > There is no perfect solution.
> > If DHCP works then IPv6 breaks?
> 
> Instead of asserting carrier when the bridge have no port, can't we assert carrier when the three 
> following condition are true at the same time :
> 
> - The bridge have no port.
> - At least one IP address is setup on the bridge.
> - The two above conditions are true for more than a configurable amount of seconds, with a default 
> of 10, for example.
> 
> This would only delay carrier on for a few seconds for the regression and keep the current behavior 
> (carrier off until at least 1 port is on) for DHCP.

This fails on two counts:
1. Bridge's often run without IP addresses!
2. DHCP won't try and send out request until carrier is true.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-02 22:11     ` Stephen Hemminger
  2011-09-03  2:15       ` Ang Way Chuang
@ 2011-09-03 18:32       ` Nicolas de Pesloüan
  2011-09-04  4:14         ` Stephen Hemminger
  1 sibling, 1 reply; 34+ messages in thread
From: Nicolas de Pesloüan @ 2011-09-03 18:32 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

Le 03/09/2011 00:11, Stephen Hemminger a écrit :
> On Fri, 02 Sep 2011 23:39:03 +0200
> Nicolas de Pesloüan<nicolas.2p.debian@gmail.com>  wrote:
>
>> Le 02/09/2011 19:22, Stephen Hemminger a écrit :
>>> This resolves a regression seen by some users of bridging.
>>> Some users use the bridge like a dummy device.
>>> They expect to be able to put an IPv6 address on the device
>>> with no ports attached during boot.
>>>
>>> Note: the bridge still will reflect the state of ports in the
>>> bridge if there are any added.
>>
>> Doesn't this jeopardize the behavior introduced in 1faa4356a3bd89ea11fb92752d897cff3a20ec0e
>> "bridge: control carrier based on ports online"?
>>
>> If the user starts the DHCP client before adding the first port to the bridge, the DHCP client will
>> have a carrier and start the autoconfiguration process. This was the old behavior, but you fixed it.
>>
>> 	Nicolas.
>>
>
> There is no perfect solution.
> If DHCP works then IPv6 breaks?

Instead of asserting carrier when the bridge have no port, can't we assert carrier when the three 
following condition are true at the same time :

- The bridge have no port.
- At least one IP address is setup on the bridge.
- The two above conditions are true for more than a configurable amount of seconds, with a default 
of 10, for example.

This would only delay carrier on for a few seconds for the regression and keep the current behavior 
(carrier off until at least 1 port is on) for DHCP.

	Nicolas.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-03  2:15       ` Ang Way Chuang
@ 2011-09-03  6:30         ` Stephen Hemminger
  2011-09-25  8:55         ` Marc Haber
  1 sibling, 0 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-09-03  6:30 UTC (permalink / raw)
  To: Ang Way Chuang
  Cc: Nicolas de Pesloüan, David S. Miller, netdev, Achmad Basuki

On Sat, 03 Sep 2011 11:15:41 +0900
Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:

> A more ideal solution in this case is to add the option to enabling carrier on sysfs and modify libvirtd
> to turn on the carrier if IPv6 is enabled. But it will still break the existing configuration until everyone
> upgrade to the latest libvirtd and kernel. Since there is no other complain from other user with this setup,
> I guess nobody actually assigns IPv6 to libvirtd network device at this moment (partly because virt-manager
> doesn't expose that functionality yet??).

Not sure about adding an option to support a configuration that is only available
by manually editing the xml files. There can't be that many people using libvirt in
this way, and fixing libvirt seems like a better solution.

Rather than rush in a kludge to handle this, let's take a few days and
examine what libvirt is trying to do and how it is doing it.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-02 22:11     ` Stephen Hemminger
@ 2011-09-03  2:15       ` Ang Way Chuang
  2011-09-03  6:30         ` Stephen Hemminger
  2011-09-25  8:55         ` Marc Haber
  2011-09-03 18:32       ` Nicolas de Pesloüan
  1 sibling, 2 replies; 34+ messages in thread
From: Ang Way Chuang @ 2011-09-03  2:15 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Nicolas de Pesloüan, David S. Miller, netdev, Achmad Basuki

On 03/09/11 07:11, Stephen Hemminger wrote:
> On Fri, 02 Sep 2011 23:39:03 +0200
> Nicolas de Pesloüan <nicolas.2p.debian@gmail.com> wrote:
>
>> Le 02/09/2011 19:22, Stephen Hemminger a écrit :
>>> This resolves a regression seen by some users of bridging.
>>> Some users use the bridge like a dummy device.
>>> They expect to be able to put an IPv6 address on the device
>>> with no ports attached during boot.
>>>
>>> Note: the bridge still will reflect the state of ports in the
>>> bridge if there are any added.

Guilty as charged :) It's a valid use case in libvirtd. Thanks for the patch. I've tried your patch.
It doesn't work. There is still no carrier. Thing still break. The whole of commit
1faa4356a including the part where liveports is used to toggle carrier has to be reverted. Otherwise, it doesn't work.
I've tried that on my machine.

>> Doesn't this jeopardize the behavior introduced in 1faa4356a3bd89ea11fb92752d897cff3a20ec0e
>> "bridge: control carrier based on ports online"?
>>
>> If the user starts the DHCP client before adding the first port to the bridge, the DHCP client will 
>> have a carrier and start the autoconfiguration process. This was the old behavior, but you fixed it.
>>
>> 	Nicolas.
>>
> There is no perfect solution.
> If DHCP works then IPv6 breaks?

A more ideal solution in this case is to add the option to enabling carrier on sysfs and modify libvirtd
to turn on the carrier if IPv6 is enabled. But it will still break the existing configuration until everyone
upgrade to the latest libvirtd and kernel. Since there is no other complain from other user with this setup,
I guess nobody actually assigns IPv6 to libvirtd network device at this moment (partly because virt-manager
doesn't expose that functionality yet??).

> --
> 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
>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-02 21:39   ` Nicolas de Pesloüan
@ 2011-09-02 22:11     ` Stephen Hemminger
  2011-09-03  2:15       ` Ang Way Chuang
  2011-09-03 18:32       ` Nicolas de Pesloüan
  0 siblings, 2 replies; 34+ messages in thread
From: Stephen Hemminger @ 2011-09-02 22:11 UTC (permalink / raw)
  To: Nicolas de Pesloüan; +Cc: David S. Miller, netdev

On Fri, 02 Sep 2011 23:39:03 +0200
Nicolas de Pesloüan <nicolas.2p.debian@gmail.com> wrote:

> Le 02/09/2011 19:22, Stephen Hemminger a écrit :
> > This resolves a regression seen by some users of bridging.
> > Some users use the bridge like a dummy device.
> > They expect to be able to put an IPv6 address on the device
> > with no ports attached during boot.
> >
> > Note: the bridge still will reflect the state of ports in the
> > bridge if there are any added.
> 
> Doesn't this jeopardize the behavior introduced in 1faa4356a3bd89ea11fb92752d897cff3a20ec0e
> "bridge: control carrier based on ports online"?
> 
> If the user starts the DHCP client before adding the first port to the bridge, the DHCP client will 
> have a carrier and start the autoconfiguration process. This was the old behavior, but you fixed it.
> 
> 	Nicolas.
> 

There is no perfect solution.
If DHCP works then IPv6 breaks?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 1/2] bridge: leave carrier on for empty bridge
  2011-09-02 17:22 ` [PATCH 1/2] bridge: leave carrier on for empty bridge Stephen Hemminger
@ 2011-09-02 21:39   ` Nicolas de Pesloüan
  2011-09-02 22:11     ` Stephen Hemminger
  0 siblings, 1 reply; 34+ messages in thread
From: Nicolas de Pesloüan @ 2011-09-02 21:39 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev

Le 02/09/2011 19:22, Stephen Hemminger a écrit :
> This resolves a regression seen by some users of bridging.
> Some users use the bridge like a dummy device.
> They expect to be able to put an IPv6 address on the device
> with no ports attached during boot.
>
> Note: the bridge still will reflect the state of ports in the
> bridge if there are any added.

Doesn't this jeopardize the behavior introduced in 1faa4356a3bd89ea11fb92752d897cff3a20ec0e
"bridge: control carrier based on ports online"?

If the user starts the DHCP client before adding the first port to the bridge, the DHCP client will 
have a carrier and start the autoconfiguration process. This was the old behavior, but you fixed it.

	Nicolas.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 1/2] bridge: leave carrier on for empty bridge
       [not found] <20110902172220.830228928@vyatta.com>
@ 2011-09-02 17:22 ` Stephen Hemminger
  2011-09-02 21:39   ` Nicolas de Pesloüan
  0 siblings, 1 reply; 34+ messages in thread
From: Stephen Hemminger @ 2011-09-02 17:22 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

[-- Attachment #1: br-carrier-default.patch --]
[-- Type: text/plain, Size: 955 bytes --]

This resolves a regression seen by some users of bridging.
Some users use the bridge like a dummy device. 
They expect to be able to put an IPv6 address on the device
with no ports attached during boot.

Note: the bridge still will reflect the state of ports in the
bridge if there are any added.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
This fix needs to go to stable for 3.0 and 2.6.39


--- a/net/bridge/br_device.c	2011-09-01 08:52:27.596631192 -0700
+++ b/net/bridge/br_device.c	2011-09-01 09:01:03.256611801 -0700
@@ -91,7 +91,6 @@ static int br_dev_open(struct net_device
 {
 	struct net_bridge *br = netdev_priv(dev);
 
-	netif_carrier_off(dev);
 	netdev_update_features(dev);
 	netif_start_queue(dev);
 	br_stp_enable_bridge(br);
@@ -108,8 +107,6 @@ static int br_dev_stop(struct net_device
 {
 	struct net_bridge *br = netdev_priv(dev);
 
-	netif_carrier_off(dev);
-
 	br_stp_disable_bridge(br);
 	br_multicast_stop(br);
 

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2011-10-18  0:00 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20111004041444.793960297@vyatta.com>
2011-10-04  4:14 ` [PATCH 1/2] bridge: leave carrier on for empty bridge Stephen Hemminger
2011-10-06 19:28   ` David Miller
2011-10-04  4:14 ` [PATCH 2/2] bridge: allow forwarding some link local frames Stephen Hemminger
2011-10-04 19:11   ` Benjamin Poirier
2011-10-05 19:40   ` Ben Hutchings
2011-10-05 20:50     ` Stephen Hemminger
2011-10-06 19:28   ` David Miller
2011-10-17 14:35   ` Ed Swierk
2011-10-17 15:18     ` Stephen Hemminger
2011-10-17 20:53     ` Ross Brattain
2011-10-17 21:09       ` Ed Swierk
2011-10-17 23:07         ` Ross Brattain
2011-10-17 23:36           ` Ed Swierk
2011-10-18  0:00             ` John Fastabend
     [not found] <20110902172220.830228928@vyatta.com>
2011-09-02 17:22 ` [PATCH 1/2] bridge: leave carrier on for empty bridge Stephen Hemminger
2011-09-02 21:39   ` Nicolas de Pesloüan
2011-09-02 22:11     ` Stephen Hemminger
2011-09-03  2:15       ` Ang Way Chuang
2011-09-03  6:30         ` Stephen Hemminger
2011-09-25  8:55         ` Marc Haber
2011-09-03 18:32       ` Nicolas de Pesloüan
2011-09-04  4:14         ` Stephen Hemminger
2011-09-04  7:35           ` Nicolas de Pesloüan
2011-09-04 16:36             ` Stephen Hemminger
2011-09-04 17:12               ` Krzysztof Olędzki
2011-09-05  4:51                 ` Ang Way Chuang
2011-09-05 17:18               ` Nicolas de Pesloüan
2011-09-05 17:57                 ` Stephen Hemminger
2011-09-05 19:02                   ` Ang Way Chuang
2011-09-05 22:45                     ` Stephen Hemminger
2011-09-06  6:52                   ` Nicolas de Pesloüan
2011-09-25  9:16                     ` Marc Haber
2011-09-25 20:10                       ` Nicolas de Pesloüan
2011-09-25  9:05             ` Marc Haber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.