Merge branch 'i2c/for-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
[cascardo/linux.git] / net / ipv4 / tcp_offload.c
index 5c59649..bc68da3 100644 (file)
@@ -90,12 +90,6 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb,
                goto out;
        }
 
-       /* GSO partial only requires splitting the frame into an MSS
-        * multiple and possibly a remainder.  So update the mss now.
-        */
-       if (features & NETIF_F_GSO_PARTIAL)
-               mss = skb->len - (skb->len % mss);
-
        copy_destructor = gso_skb->destructor == tcp_wfree;
        ooo_okay = gso_skb->ooo_okay;
        /* All segments but the first should have ooo_okay cleared */
@@ -108,6 +102,13 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb,
        /* Only first segment might have ooo_okay set */
        segs->ooo_okay = ooo_okay;
 
+       /* GSO partial and frag_list segmentation only requires splitting
+        * the frame into an MSS multiple and possibly a remainder, both
+        * cases return a GSO skb. So update the mss now.
+        */
+       if (skb_is_gso(segs))
+               mss *= skb_shinfo(segs)->gso_segs;
+
        delta = htonl(oldlen + (thlen + mss));
 
        skb = segs;