Skip to content

Commit

Permalink
compat: Fix gre header bug
Browse files Browse the repository at this point in the history
Commit 436d36d introduced a bug into the gre header build for gre and
ip gre type tunnels.  __vlan_hwaccel_push_inside does not check whether
the vlan tag is even present.  So check first and avoid padding space
for a vlan tag that isn't present.

Fixes: 436d36d ("compat: Fixups for newer kernels")
Signed-off-by: Greg Rose <[email protected]>
Acked-by: William Tu <[email protected]>
Signed-off-by: Justin Pettit <[email protected]>
  • Loading branch information
gvrose8192 authored and justinpettit committed Jun 29, 2018
1 parent 4c0583d commit 56174c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions datapath/linux/compat/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,12 @@ netdev_tx_t rpl_gre_fb_xmit(struct sk_buff *skb)
goto err_free_rt;
}

skb = __vlan_hwaccel_push_inside(skb);
if (unlikely(!skb)) {
err = -ENOMEM;
goto err_free_rt;
if (skb_vlan_tag_present(skb)) {
skb = __vlan_hwaccel_push_inside(skb);
if (unlikely(!skb)) {
err = -ENOMEM;
goto err_free_rt;
}
}

/* Push Tunnel header. */
Expand Down

0 comments on commit 56174c2

Please sign in to comment.