Skip to content

Commit

Permalink
bonding/vlan: Fix mangled NAs on slaves without VLAN tag insertion
Browse files Browse the repository at this point in the history
bond_na_send() attempts to insert a VLAN tag in between building and
sending packets of the respective formats.  If the slave does not
implement hardware VLAN tag insertion then vlan_put_tag() will mangle
the network-layer header because the Ethernet header is not present at
this point (unlike in bond_arp_send()).

Fix this by adding the tag out-of-line and relying on
dev_hard_start_xmit() to insert it inline if necessary.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Reviewed-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Dec 16, 2010
1 parent ffa95ed commit f88a4a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/bonding/bond_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ static void bond_na_send(struct net_device *slave_dev,
}

if (vlan_id) {
skb = vlan_put_tag(skb, vlan_id);
/* The Ethernet header is not present yet, so it is
* too early to insert a VLAN tag. Force use of an
* out-of-line tag here and let dev_hard_start_xmit()
* insert it if the slave hardware can't.
*/
skb = __vlan_hwaccel_put_tag(skb, vlan_id);
if (!skb) {
pr_err("failed to insert VLAN tag\n");
return;
Expand Down

0 comments on commit f88a4a9

Please sign in to comment.