Now GRE64 deals with tunnel with no key and tunnel with zero key
as a same. This behaviour is different than standard GRE.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
if (mutable->flags & TNL_F_CSUM)
len += GRE_HEADER_SECTION;
if (mutable->flags & TNL_F_CSUM)
len += GRE_HEADER_SECTION;
- if (mutable->out_key || mutable->flags & TNL_F_OUT_KEY_ACTION) {
+ /* Set key for GRE64 tunnels, even when key if is zero. */
+ if (mutable->out_key ||
+ mutable->key.tunnel_type & TNL_T_PROTO_GRE64 ||
+ mutable->flags & TNL_F_OUT_KEY_ACTION) {
+
len += GRE_HEADER_SECTION;
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
len += GRE_HEADER_SECTION;
len += GRE_HEADER_SECTION;
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
len += GRE_HEADER_SECTION;
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
greh->flags |= GRE_SEQ;
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
greh->flags |= GRE_SEQ;
- } else if (mutable->out_key) {
+ } else if (mutable->out_key ||
+ mutable->key.tunnel_type & TNL_T_PROTO_GRE64) {
greh->flags |= GRE_KEY;
*options = be64_get_low32(mutable->out_key);
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64) {
greh->flags |= GRE_KEY;
*options = be64_get_low32(mutable->out_key);
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64) {
}
*options = be64_get_low32(OVS_CB(skb)->tun_id);
options--;
}
*options = be64_get_low32(OVS_CB(skb)->tun_id);
options--;
- } else if (mutable->out_key) {
+ } else if (mutable->out_key ||
+ mutable->key.tunnel_type & TNL_T_PROTO_GRE64) {
options--;
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
options--;
options--;
if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
options--;