netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vlan: Set correct source MAC address with TX VLAN offload enabled
@ 2014-03-10 15:17 Peter Boström
  2014-03-11  2:22 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Boström @ 2014-03-10 15:17 UTC (permalink / raw)
  To: kaber; +Cc: davem, netdev, linux-kernel

With TX VLAN offload enabled the source MAC address for frames sent using the
VLAN interface is currently set to the address of the real interface. This is
wrong since the VLAN interface may be configured with a different address.

The bug was introduced in commit 2205369a314e12fcec4781cc73ac9c08fc2b47de
("vlan: Fix header ops passthru when doing TX VLAN offload.").

This patch sets the source address before calling the create function of the
real interface.

Signed-off-by: Peter Boström <peter.bostrom@netrounds.com>
---
 net/8021q/vlan_dev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index de51c48..4b65aa4 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -538,6 +538,9 @@ static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *dev
 	struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
 	struct net_device *real_dev = vlan->real_dev;
 
+	if (saddr == NULL)
+		saddr = dev->dev_addr;
+
 	return dev_hard_header(skb, real_dev, type, daddr, saddr, len);
 }
 

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

* Re: [PATCH] vlan: Set correct source MAC address with TX VLAN offload enabled
  2014-03-10 15:17 [PATCH] vlan: Set correct source MAC address with TX VLAN offload enabled Peter Boström
@ 2014-03-11  2:22 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-03-11  2:22 UTC (permalink / raw)
  To: peter.bostrom; +Cc: kaber, netdev, linux-kernel

From: Peter Boström <peter.bostrom@netrounds.com>
Date: Mon, 10 Mar 2014 16:17:15 +0100

> With TX VLAN offload enabled the source MAC address for frames sent using the
> VLAN interface is currently set to the address of the real interface. This is
> wrong since the VLAN interface may be configured with a different address.
> 
> The bug was introduced in commit 2205369a314e12fcec4781cc73ac9c08fc2b47de
> ("vlan: Fix header ops passthru when doing TX VLAN offload.").
> 
> This patch sets the source address before calling the create function of the
> real interface.
> 
> Signed-off-by: Peter Boström <peter.bostrom@netrounds.com>

Good catch.

Applied and queued up for -stable, thanks!

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

end of thread, other threads:[~2014-03-11  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10 15:17 [PATCH] vlan: Set correct source MAC address with TX VLAN offload enabled Peter Boström
2014-03-11  2:22 ` David Miller

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