- struct gre_base_hdr *greh = (struct gre_base_hdr *)skb_transport_header(skb);
- __be32 *options = (__be32 *)(skb_network_header(skb) + mutable->tunnel_hlen
- - GRE_HEADER_SECTION);
+#ifdef __BIG_ENDIAN
+ return (__force __be32)x;
+#else
+ return (__force __be32)((__force u64)x >> 32);
+#endif
+}
+
+static void gre_build_header(const struct vport *vport,
+ const struct tnl_mutable_config *mutable,
+ void *header)
+{
+ struct gre_base_hdr *greh = header;
+ __be32 *options = (__be32 *)(greh + 1);