Merge tag 'platform-drivers-x86-v4.6-1' of git://git.infradead.org/users/dvhart/linux...
[deliverable/linux.git] / net / ipv4 / tcp_fastopen.c
index fdb286ddba04e548eb47c006ac9c334fa21d07ef..cffd8f9ed1a953031e0a08c090c17c0bcd62effa 100644 (file)
@@ -1,3 +1,4 @@
+#include <linux/crypto.h>
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -140,6 +141,14 @@ void tcp_fastopen_add_skb(struct sock *sk, struct sk_buff *skb)
                return;
 
        skb_dst_drop(skb);
+       /* segs_in has been initialized to 1 in tcp_create_openreq_child().
+        * Hence, reset segs_in to 0 before calling tcp_segs_in()
+        * to avoid double counting.  Also, tcp_segs_in() expects
+        * skb->len to include the tcp_hdrlen.  Hence, it should
+        * be called before __skb_pull().
+        */
+       tp->segs_in = 0;
+       tcp_segs_in(tp, skb);
        __skb_pull(skb, tcp_hdrlen(skb));
        skb_set_owner_r(skb, sk);
 
This page took 0.037048 seconds and 5 git commands to generate.