Commit dd38743b4cc2f86be250eaf156cf113ba3dd531a

Authored by Peter Boström
Committed by David S. Miller
1 parent 5bd0767086

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

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

net/8021q/vlan_dev.c
... ... @@ -538,6 +538,9 @@
538 538 struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
539 539 struct net_device *real_dev = vlan->real_dev;
540 540  
  541 + if (saddr == NULL)
  542 + saddr = dev->dev_addr;
  543 +
541 544 return dev_hard_header(skb, real_dev, type, daddr, saddr, len);
542 545 }
543 546