diff options
author | Jesse Gross <jesse@nicira.com> | 2015-04-09 11:19:14 -0700 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-04-27 17:13:41 -0400 |
commit | 218aa70e49b61fd49691a688309bdee22608c9bb (patch) | |
tree | 6cf9af20e9768ba36d62d4f71e6fe7016fa7d4eb /net | |
parent | 754a19948ec440acc781d3870d48329c802a6eb7 (diff) |
udptunnels: Call handle_offloads after inserting vlan tag.
[ Upstream commit b736a623bd099cdf5521ca9bd03559f3bc7fa31c ]
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/geneve.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/geneve.c b/net/ipv4/geneve.c index fd0fe18e3e3e..d5423e33d32b 100644 --- a/net/ipv4/geneve.c +++ b/net/ipv4/geneve.c @@ -121,8 +121,6 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt, int min_headroom; int err; - skb = udp_tunnel_handle_offloads(skb, !gs->sock->sk->sk_no_check_tx); - min_headroom = LL_RESERVED_SPACE(rt->dst.dev) + rt->dst.header_len + GENEVE_BASE_HLEN + opt_len + sizeof(struct iphdr) + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); @@ -135,6 +133,10 @@ int geneve_xmit_skb(struct geneve_sock *gs, struct rtable *rt, if (unlikely(!skb)) return -ENOMEM; + skb = udp_tunnel_handle_offloads(skb, !gs->sock->sk->sk_no_check_tx); + if (IS_ERR(skb)) + return PTR_ERR(skb); + gnvh = (struct genevehdr *)__skb_push(skb, sizeof(*gnvh) + opt_len); geneve_build_header(gnvh, tun_flags, vni, opt_len, opt); |