Commit c99f58d7 authored by Peter Boström's avatar Peter Boström Committed by Ben Hutchings

vlan: Set correct source MAC address with TX VLAN offload enabled

[ Upstream commit dd38743b ]

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 2205369a
("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: default avatarPeter Boström <peter.bostrom@netrounds.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent e7177969
...@@ -529,6 +529,9 @@ static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *dev ...@@ -529,6 +529,9 @@ static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *dev
{ {
struct net_device *real_dev = vlan_dev_info(dev)->real_dev; struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
if (saddr == NULL)
saddr = dev->dev_addr;
return dev_hard_header(skb, real_dev, type, daddr, saddr, len); return dev_hard_header(skb, real_dev, type, daddr, saddr, len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment