netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST
@ 2014-06-23 14:33 Maxime Bizon
  2014-06-25 23:09 ` David Miller
  2014-06-25 23:13 ` Stephen Hemminger
  0 siblings, 2 replies; 6+ messages in thread
From: Maxime Bizon @ 2014-06-23 14:33 UTC (permalink / raw)
  To: stephen; +Cc: davem, netdev, bridge, Maxime Bizon

The bridge code only set PACKET_HOST on packets sent to the bridge mac
address, packets sent to other local mac addresses are sent to upper
layers, but ignored because they are marked as PACKET_OTHERHOST.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 net/bridge/br_input.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 366c436..b9cc8554 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -120,6 +120,7 @@ int br_handle_frame_finish(struct sk_buff *skb)
 			dst->is_local) {
 		skb2 = skb;
 		/* Do not forward the packet since it's local. */
+		skb2->pkt_type = PACKET_HOST;
 		skb = NULL;
 	}
 
-- 
1.7.9.5

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

* Re: [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST
  2014-06-23 14:33 [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST Maxime Bizon
@ 2014-06-25 23:09 ` David Miller
  2014-06-25 23:13 ` Stephen Hemminger
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-06-25 23:09 UTC (permalink / raw)
  To: mbizon; +Cc: stephen, netdev, bridge

From: Maxime Bizon <mbizon@freebox.fr>
Date: Mon, 23 Jun 2014 16:33:35 +0200

> The bridge code only set PACKET_HOST on packets sent to the bridge mac
> address, packets sent to other local mac addresses are sent to upper
> layers, but ignored because they are marked as PACKET_OTHERHOST.
> 
> Signed-off-by: Maxime Bizon <mbizon@freebox.fr>

This looks fine to me, Stephen and other bridge hackers please review.

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

* Re: [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST
  2014-06-23 14:33 [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST Maxime Bizon
  2014-06-25 23:09 ` David Miller
@ 2014-06-25 23:13 ` Stephen Hemminger
  2014-06-26 11:15   ` Maxime Bizon
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2014-06-25 23:13 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: netdev, bridge, davem

On Mon, 23 Jun 2014 16:33:35 +0200
Maxime Bizon <mbizon@freebox.fr> wrote:

> The bridge code only set PACKET_HOST on packets sent to the bridge mac
> address, packets sent to other local mac addresses are sent to upper
> layers, but ignored because they are marked as PACKET_OTHERHOST.
> 
> Signed-off-by: Maxime Bizon <mbizon@freebox.fr>

What are you trying to do? Bridge device itself only has one MAC address.
Are you trying to run macvlan on top of bridge?
We only respond to ARP with bridge's MAC address.

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

* Re: [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST
  2014-06-25 23:13 ` Stephen Hemminger
@ 2014-06-26 11:15   ` Maxime Bizon
  2014-06-26 20:35     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Maxime Bizon @ 2014-06-26 11:15 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: davem, netdev, bridge


On Wed, 2014-06-25 at 16:13 -0700, Stephen Hemminger wrote:

> > The bridge code only set PACKET_HOST on packets sent to the bridge mac
> > address, packets sent to other local mac addresses are sent to upper
> > layers, but ignored because they are marked as PACKET_OTHERHOST.
> > 
> > Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
> 
> What are you trying to do? Bridge device itself only has one MAC address.
> Are you trying to run macvlan on top of bridge?
> We only respond to ARP with bridge's MAC address.

host1 uses a bridge with two interfaces: ethernet and wireless (AP mode
using hostapd)

for some reasons, hostapd kept adding and removing the interface from
the bridge, triggering a mac address of the bridge change each time (I
did not notice that).

Another host had a static arp entry for host1, using the ethernet mac
address, so its packets to host1 were randomly trashed depending on the
current mac of the bridge.

I have since fixed this by setting a static mac address on the bridge to
prevent dynamic change, but I thought this patch would prevent other
people from having the same bug in the future.

What do you think ?

-- 
Maxime

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

* Re: [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST
  2014-06-26 11:15   ` Maxime Bizon
@ 2014-06-26 20:35     ` David Miller
  2014-06-26 21:19       ` Maxime Bizon
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-06-26 20:35 UTC (permalink / raw)
  To: mbizon; +Cc: stephen, netdev, bridge

From: Maxime Bizon <mbizon@freebox.fr>
Date: Thu, 26 Jun 2014 13:15:52 +0200

> for some reasons, hostapd kept adding and removing the interface from
> the bridge, triggering a mac address of the bridge change each time (I
> did not notice that).

I think this is what you need to investigate rather than making
changes to the bridge layer.

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

* Re: [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST
  2014-06-26 20:35     ` David Miller
@ 2014-06-26 21:19       ` Maxime Bizon
  0 siblings, 0 replies; 6+ messages in thread
From: Maxime Bizon @ 2014-06-26 21:19 UTC (permalink / raw)
  To: David Miller; +Cc: stephen, netdev, bridge


On Thursday 26 Jun 2014 à 13:35:50 (-0700), David Miller wrote:

> > for some reasons, hostapd kept adding and removing the interface from
> > the bridge, triggering a mac address of the bridge change each time (I
> > did not notice that).
> 
> I think this is what you need to investigate rather than making
> changes to the bridge layer.

Of course I fixed the problem with hostapd, I was just explaining how
I noticed that behaviour in the bridge code.

If that behaviour is intended then just forget that patch.

-- 
Maxime

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

end of thread, other threads:[~2014-06-26 21:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-23 14:33 [PATCH] bridge: mark packets sent to any local mac address as PACKET_HOST Maxime Bizon
2014-06-25 23:09 ` David Miller
2014-06-25 23:13 ` Stephen Hemminger
2014-06-26 11:15   ` Maxime Bizon
2014-06-26 20:35     ` David Miller
2014-06-26 21:19       ` Maxime Bizon

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