netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next v2] bonding: pass link-local packets to bonding master also.
@ 2018-07-18 19:55 Mahesh Bandewar
  2018-07-18 20:18 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Mahesh Bandewar @ 2018-07-18 19:55 UTC (permalink / raw)
  To: Jay Vosburgh, Andy Gospodarek, Veaceslav Falico, David Miller
  Cc: Netdev, Michal Soltys, Mahesh Bandewar, Mahesh Bandewar

From: Mahesh Bandewar <maheshb@google.com>

Commit b89f04c61efe ("bonding: deliver link-local packets with
skb->dev set to link that packets arrived on") changed the behavior
of how link-local-multicast packets are processed. The change in
the behavior broke some legacy use cases where these packets are
expected to arrive on bonding master device also.

This patch passes the packet to the stack with the link it arrived
on as well as passes to the bonding-master device to preserve the
legacy use case.

Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
Reported-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
v2: Added Fixes tag.
v1: Initial patch.
 drivers/net/bonding/bond_main.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 9a2ea3c1f949..1d3b7d8448f2 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1177,9 +1177,22 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
 		}
 	}
 
-	/* don't change skb->dev for link-local packets */
-	if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
+	/* Link-local multicast packets should be passed to the
+	 * stack on the link they arrive as well as pass them to the
+	 * bond-master device. These packets are mostly usable when
+	 * stack receives it with the link on which they arrive
+	 * (e.g. LLDP) but there may be some legacy behavior that
+	 * expects these packets to appear on bonding master too.
+	 */
+	if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) {
+		struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
+
+		if (nskb) {
+			nskb->dev = bond->dev;
+			netif_rx(nskb);
+		}
 		return RX_HANDLER_PASS;
+	}
 	if (bond_should_deliver_exact_match(skb, slave, bond))
 		return RX_HANDLER_EXACT;
 
-- 
2.18.0.203.gfac676dfb9-goog

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

* Re: [PATCH next v2] bonding: pass link-local packets to bonding master also.
  2018-07-18 19:55 [PATCH next v2] bonding: pass link-local packets to bonding master also Mahesh Bandewar
@ 2018-07-18 20:18 ` David Miller
  2018-07-18 23:19   ` Mahesh Bandewar (महेश बंडेवार)
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2018-07-18 20:18 UTC (permalink / raw)
  To: mahesh; +Cc: j.vosburgh, andy, vfalico, netdev, soltys, maheshb

From: Mahesh Bandewar <mahesh@bandewar.net>
Date: Wed, 18 Jul 2018 12:55:42 -0700

> From: Mahesh Bandewar <maheshb@google.com>
> 
> Commit b89f04c61efe ("bonding: deliver link-local packets with
> skb->dev set to link that packets arrived on") changed the behavior
> of how link-local-multicast packets are processed. The change in
> the behavior broke some legacy use cases where these packets are
> expected to arrive on bonding master device also.
> 
> This patch passes the packet to the stack with the link it arrived
> on as well as passes to the bonding-master device to preserve the
> legacy use case.
> 
> Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
> Reported-by: Michal Soltys <soltys@ziu.info>
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>

If this is a regression, it should target 'net' rather than 'net-next'
so we can queue it up for -stable as well.

Thank you.

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

* Re: [PATCH next v2] bonding: pass link-local packets to bonding master also.
  2018-07-18 20:18 ` David Miller
@ 2018-07-18 23:19   ` Mahesh Bandewar (महेश बंडेवार)
  2018-07-18 23:33     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-07-18 23:19 UTC (permalink / raw)
  To: David Miller; +Cc: mahesh, j.vosburgh, andy, vfalico, linux-netdev, soltys

On Wed, Jul 18, 2018 at 1:18 PM, David Miller <davem@davemloft.net> wrote:
> From: Mahesh Bandewar <mahesh@bandewar.net>
> Date: Wed, 18 Jul 2018 12:55:42 -0700
>
>> From: Mahesh Bandewar <maheshb@google.com>
>>
>> Commit b89f04c61efe ("bonding: deliver link-local packets with
>> skb->dev set to link that packets arrived on") changed the behavior
>> of how link-local-multicast packets are processed. The change in
>> the behavior broke some legacy use cases where these packets are
>> expected to arrive on bonding master device also.
>>
>> This patch passes the packet to the stack with the link it arrived
>> on as well as passes to the bonding-master device to preserve the
>> legacy use case.
>>
>> Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
>> Reported-by: Michal Soltys <soltys@ziu.info>
>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>
> If this is a regression, it should target 'net' rather than 'net-next'
> so we can queue it up for -stable as well.
>
Yes, it is. Just forgot to revise the subject. Do you want me to
resend the patch?

thanks,
--mahesh..

> Thank you.

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

* Re: [PATCH next v2] bonding: pass link-local packets to bonding master also.
  2018-07-18 23:19   ` Mahesh Bandewar (महेश बंडेवार)
@ 2018-07-18 23:33     ` David Miller
  2018-07-18 23:40       ` Mahesh Bandewar (महेश बंडेवार)
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2018-07-18 23:33 UTC (permalink / raw)
  To: maheshb; +Cc: mahesh, j.vosburgh, andy, vfalico, netdev, soltys

From: Mahesh Bandewar (महेश बंडेवार) <maheshb@google.com>
Date: Wed, 18 Jul 2018 16:19:17 -0700

> On Wed, Jul 18, 2018 at 1:18 PM, David Miller <davem@davemloft.net> wrote:
>> From: Mahesh Bandewar <mahesh@bandewar.net>
>> Date: Wed, 18 Jul 2018 12:55:42 -0700
>>
>>> From: Mahesh Bandewar <maheshb@google.com>
>>>
>>> Commit b89f04c61efe ("bonding: deliver link-local packets with
>>> skb->dev set to link that packets arrived on") changed the behavior
>>> of how link-local-multicast packets are processed. The change in
>>> the behavior broke some legacy use cases where these packets are
>>> expected to arrive on bonding master device also.
>>>
>>> This patch passes the packet to the stack with the link it arrived
>>> on as well as passes to the bonding-master device to preserve the
>>> legacy use case.
>>>
>>> Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
>>> Reported-by: Michal Soltys <soltys@ziu.info>
>>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>>
>> If this is a regression, it should target 'net' rather than 'net-next'
>> so we can queue it up for -stable as well.
>>
> Yes, it is. Just forgot to revise the subject. Do you want me to
> resend the patch?

Yes, please.

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

* Re: [PATCH next v2] bonding: pass link-local packets to bonding master also.
  2018-07-18 23:33     ` David Miller
@ 2018-07-18 23:40       ` Mahesh Bandewar (महेश बंडेवार)
  0 siblings, 0 replies; 5+ messages in thread
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-07-18 23:40 UTC (permalink / raw)
  To: David Miller; +Cc: mahesh, j.vosburgh, andy, vfalico, linux-netdev, soltys

On Wed, Jul 18, 2018 at 4:33 PM, David Miller <davem@davemloft.net> wrote:
> From: Mahesh Bandewar (महेश बंडेवार) <maheshb@google.com>
> Date: Wed, 18 Jul 2018 16:19:17 -0700
>
>> On Wed, Jul 18, 2018 at 1:18 PM, David Miller <davem@davemloft.net> wrote:
>>> From: Mahesh Bandewar <mahesh@bandewar.net>
>>> Date: Wed, 18 Jul 2018 12:55:42 -0700
>>>
>>>> From: Mahesh Bandewar <maheshb@google.com>
>>>>
>>>> Commit b89f04c61efe ("bonding: deliver link-local packets with
>>>> skb->dev set to link that packets arrived on") changed the behavior
>>>> of how link-local-multicast packets are processed. The change in
>>>> the behavior broke some legacy use cases where these packets are
>>>> expected to arrive on bonding master device also.
>>>>
>>>> This patch passes the packet to the stack with the link it arrived
>>>> on as well as passes to the bonding-master device to preserve the
>>>> legacy use case.
>>>>
>>>> Fixes: b89f04c61efe ("bonding: deliver link-local packets with skb->dev set to link that packets arrived on")
>>>> Reported-by: Michal Soltys <soltys@ziu.info>
>>>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>>>
>>> If this is a regression, it should target 'net' rather than 'net-next'
>>> so we can queue it up for -stable as well.
>>>
>> Yes, it is. Just forgot to revise the subject. Do you want me to
>> resend the patch?
>
> Yes, please.
sure, will do.

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

end of thread, other threads:[~2018-07-19  0:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18 19:55 [PATCH next v2] bonding: pass link-local packets to bonding master also Mahesh Bandewar
2018-07-18 20:18 ` David Miller
2018-07-18 23:19   ` Mahesh Bandewar (महेश बंडेवार)
2018-07-18 23:33     ` David Miller
2018-07-18 23:40       ` Mahesh Bandewar (महेश बंडेवार)

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