datapath: Fix GRE tunnel without any key.
authorPravin B Shelar <pshelar@nicira.com>
Tue, 9 Oct 2012 23:08:39 +0000 (16:08 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Tue, 9 Oct 2012 23:08:39 +0000 (16:08 -0700)
Commit 2de795adb96 (datapath: 64-bit GRE support) introduced a bug
for tunnels with no key. Following patch fixes it by setting tunnel
type to GRE type.

Bugs: 13511
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
datapath/vport-gre.c

index 6f406bc9c36e37524c792419ee0d195fafbbaeee..4000c749b296c87e9505c6de58d1deb36fa92d7d 100644 (file)
@@ -202,8 +202,11 @@ static int parse_header(struct iphdr *iph, __be16 *flags, __be64 *tun_id,
                        *tunnel_type = TNL_T_PROTO_GRE;
                }
                *tun_id = key_to_tunnel_id(gre_key, seq);
-       } else
+       } else {
                *tun_id = 0;
+               /* Ignore GRE seq if there is no key present. */
+               *tunnel_type = TNL_T_PROTO_GRE;
+       }
 
        if (greh->flags & GRE_SEQ)
                hdr_len += GRE_HEADER_SECTION;