Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / gre.c
index e20631cb418573599e68b3e94a69f76f00e0f73f..d2d5a99fba0983a4dead0909e30212c84f72154b 100644 (file)
 
 static const struct gre_protocol __rcu *gre_proto[GREPROTO_MAX] __read_mostly;
 static DEFINE_SPINLOCK(gre_proto_lock);
-struct gre_base_hdr {
-       __be16 flags;
-       __be16 protocol;
-};
-#define GRE_HEADER_SECTION 4
 
 int gre_add_protocol(const struct gre_protocol *proto, u8 version)
 {
@@ -125,9 +120,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
        netdev_features_t enc_features;
        int ghl = GRE_HEADER_SECTION;
        struct gre_base_hdr *greh;
-       struct iphdr *iph;
        int mac_len = skb->mac_len;
-       int tnl_hlen, id;
+       int tnl_hlen;
        bool csum;
 
        if (unlikely(skb_shinfo(skb)->gso_type &
@@ -171,8 +165,6 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
        skb_set_network_header(skb, skb_inner_network_offset(skb));
        skb->mac_len = skb_inner_network_offset(skb);
 
-       iph = ip_hdr(skb);
-       id = ntohs(iph->id);
        /* segment inner packet. */
        enc_features = skb->dev->hw_enc_features & netif_skb_features(skb);
        segs = skb_mac_gso_segment(skb, enc_features);
@@ -182,8 +174,6 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
        skb = segs;
        tnl_hlen = skb_tnl_header_len(skb);
        do {
-               iph = (struct iphdr *)skb->data;
-               iph->id = htons(id++);
                __skb_push(skb, ghl);
                if (csum) {
                        __be32 *pcsum;