[ovs-dev] [PATCH V2 1/2] compat: Fix gre header bug

Greg Rose gvrose8192 at gmail.com
Fri Jun 29 03:31:25 UTC 2018


Commit 436d36db 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: 436d36db ("compat: Fixups for newer kernels")
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
---
 datapath/linux/compat/ip_gre.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index ac9fb8b..df0217e 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -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. */
-- 
1.8.3.1



More information about the dev mailing list