aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2015-04-09 14:19:14 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-09 14:56:32 -0400
commitb736a623bd099cdf5521ca9bd03559f3bc7fa31c (patch)
tree3a08ef493465c9d8d9c73c0763c651a399ee9160 /drivers/net/vxlan.c
parent634d8ee4de9e41726d4f6f68f57cdd8647b3d204 (diff)
udptunnels: Call handle_offloads after inserting vlan tag.
handle_offloads() calls skb_reset_inner_headers() to store the layer pointers to the encapsulated packet. However, we currently push the vlag tag (if there is one) onto the packet afterwards. This changes the MAC header for the encapsulated packet but it is not reflected in skb->inner_mac_header, which breaks GSO and drivers which attempt to use this for encapsulation offloads. Fixes: 1eaa8178 ("vxlan: Add tx-vlan offload support.") Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index f8528a4cf54f..fceb637efd6b 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1713,12 +1713,6 @@ static int vxlan6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb,
1713 } 1713 }
1714 } 1714 }
1715 1715
1716 skb = iptunnel_handle_offloads(skb, udp_sum, type);
1717 if (IS_ERR(skb)) {
1718 err = -EINVAL;
1719 goto err;
1720 }
1721
1722 skb_scrub_packet(skb, xnet); 1716 skb_scrub_packet(skb, xnet);
1723 1717
1724 min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len 1718 min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len
@@ -1738,6 +1732,12 @@ static int vxlan6_xmit_skb(struct dst_entry *dst, struct sk_buff *skb,
1738 goto err; 1732 goto err;
1739 } 1733 }
1740 1734
1735 skb = iptunnel_handle_offloads(skb, udp_sum, type);
1736 if (IS_ERR(skb)) {
1737 err = -EINVAL;
1738 goto err;
1739 }
1740
1741 vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh)); 1741 vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh));
1742 vxh->vx_flags = htonl(VXLAN_HF_VNI); 1742 vxh->vx_flags = htonl(VXLAN_HF_VNI);
1743 vxh->vx_vni = md->vni; 1743 vxh->vx_vni = md->vni;
@@ -1798,10 +1798,6 @@ int vxlan_xmit_skb(struct rtable *rt, struct sk_buff *skb,
1798 } 1798 }
1799 } 1799 }
1800 1800
1801 skb = iptunnel_handle_offloads(skb, udp_sum, type);
1802 if (IS_ERR(skb))
1803 return PTR_ERR(skb);
1804
1805 min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len 1801 min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len
1806 + VXLAN_HLEN + sizeof(struct iphdr) 1802 + VXLAN_HLEN + sizeof(struct iphdr)
1807 + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0); 1803 + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
@@ -1817,6 +1813,10 @@ int vxlan_xmit_skb(struct rtable *rt, struct sk_buff *skb,
1817 if (WARN_ON(!skb)) 1813 if (WARN_ON(!skb))
1818 return -ENOMEM; 1814 return -ENOMEM;
1819 1815
1816 skb = iptunnel_handle_offloads(skb, udp_sum, type);
1817 if (IS_ERR(skb))
1818 return PTR_ERR(skb);
1819
1820 vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh)); 1820 vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh));
1821 vxh->vx_flags = htonl(VXLAN_HF_VNI); 1821 vxh->vx_flags = htonl(VXLAN_HF_VNI);
1822 vxh->vx_vni = md->vni; 1822 vxh->vx_vni = md->vni;