]> Pileus Git - ~andy/linux/blobdiff - include/net/tcp.h
tcp: force a dst refcount when prequeue packet
[~andy/linux] / include / net / tcp.h
index 23f2e98d4b654dbd497def51219cbe0806c23cb8..a34548041c17edccec0c0e30df5682cc22ad4ec9 100644 (file)
@@ -1045,6 +1045,11 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb)
        if (sysctl_tcp_low_latency || !tp->ucopy.task)
                return false;
 
+       if (skb->len <= tcp_hdrlen(skb) &&
+           skb_queue_len(&tp->ucopy.prequeue) == 0)
+               return false;
+
+       skb_dst_force(skb);
        __skb_queue_tail(&tp->ucopy.prequeue, skb);
        tp->ucopy.memory += skb->truesize;
        if (tp->ucopy.memory > sk->sk_rcvbuf) {