datapath: tnl-segmentation: clone dst for each segment.
authorPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 16:52:02 +0000 (09:52 -0700)
committerPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 17:25:08 +0000 (10:25 -0700)
Each skb segment needs a dst entry.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
datapath/linux/compat/gso.c

index 8812253..1f23173 100644 (file)
@@ -189,6 +189,7 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff *skb,
        int outer_l3_offset = skb_network_offset(skb);
        int outer_l4_offset = skb_transport_offset(skb);
        struct sk_buff *skb1 = skb;
+       struct dst_entry *dst = skb_dst(skb);
        struct sk_buff *segs;
        __be16 proto = skb->protocol;
        char cb[sizeof(skb->cb)];
@@ -232,9 +233,14 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff *skb,
 
                memcpy(skb_network_header(skb), iph, pkt_hlen);
                memcpy(skb->cb, cb, sizeof(cb));
-               OVS_GSO_CB(skb)->fix_segment(skb);
 
                skb->protocol = proto;
+               if (skb->next)
+                       dst = dst_clone(dst);
+
+               skb_dst_set(skb, dst);
+               OVS_GSO_CB(skb)->fix_segment(skb);
+
                skb = skb->next;
        }
 free: