提交 f88a4a9b 编写于 作者: B Ben Hutchings 提交者: David S. Miller

bonding/vlan: Fix mangled NAs on slaves without VLAN tag insertion

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: NBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: NJay Vosburgh <fubar@us.ibm.com>
Reviewed-by: NJesse Gross <jesse@nicira.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ffa95ed5
...@@ -88,7 +88,12 @@ static void bond_na_send(struct net_device *slave_dev, ...@@ -88,7 +88,12 @@ static void bond_na_send(struct net_device *slave_dev,
} }
if (vlan_id) { 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) { if (!skb) {
pr_err("failed to insert VLAN tag\n"); pr_err("failed to insert VLAN tag\n");
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册