Skip to content

Commit

Permalink
vlan: Set correct source MAC address with TX VLAN offload enabled
Browse files Browse the repository at this point in the history
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 2205369
("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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Peter Boström authored and davem330 committed Mar 11, 2014
1 parent 5bd0767 commit dd38743
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit dd38743

Please sign in to comment.