- if (mutable->flags & TNL_F_OUT_KEY_ACTION) {
- greh->flags |= GRE_KEY;
- if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
- greh->flags |= GRE_SEQ;
-
- } else if (mutable->out_key) {
- greh->flags |= GRE_KEY;
- *options = be64_get_low32(mutable->out_key);
- if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64) {
- options++;
- *options = be64_get_high32(mutable->out_key);
- greh->flags |= GRE_SEQ;
- }
- }
-}
-
-static struct sk_buff *gre_update_header(const struct vport *vport,
- const struct tnl_mutable_config *mutable,
- struct dst_entry *dst,
- struct sk_buff *skb)
-{
- __be32 *options = (__be32 *)(skb_network_header(skb) + mutable->tunnel_hlen
- - GRE_HEADER_SECTION);
-
- /* Work backwards over the options so the checksum is last. */
- if (mutable->flags & TNL_F_OUT_KEY_ACTION) {
- if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64) {
- /* Set higher 32 bits to seq. */
- *options = be64_get_high32(OVS_CB(skb)->tun_id);
- options--;
- }
- *options = be64_get_low32(OVS_CB(skb)->tun_id);
- options--;
- } else if (mutable->out_key) {
- options--;
- if (mutable->key.tunnel_type & TNL_T_PROTO_GRE64)
- options--;
- }
-
- if (mutable->flags & TNL_F_CSUM)
- *(__sum16 *)options = csum_fold(skb_checksum(skb,
- skb_transport_offset(skb),
- skb->len - skb_transport_offset(skb),
- 0));
- /*
- * Allow our local IP stack to fragment the outer packet even if the
- * DF bit is set as a last resort. We also need to force selection of
- * an IP ID here because Linux will otherwise leave it at 0 if the
- * packet originally had DF set.
- */
- skb->local_df = 1;
- __ip_select_ident(ip_hdr(skb), dst, 0);