tipc: fix skb truesize/datasize ratio control
[muen/linux.git] / net / tipc / msg.c
index 55d8ba92291d2ac15e97ed90213e40d45ab99a58..4e1c6f6450bb96d9f3c34f2ba771d740c4f98c98 100644 (file)
@@ -208,8 +208,8 @@ bool tipc_msg_validate(struct sk_buff **_skb)
        int msz, hsz;
 
        /* Ensure that flow control ratio condition is satisfied */
-       if (unlikely(skb->truesize / buf_roundup_len(skb) > 4)) {
-               skb = skb_copy(skb, GFP_ATOMIC);
+       if (unlikely(skb->truesize / buf_roundup_len(skb) >= 4)) {
+               skb = skb_copy_expand(skb, BUF_HEADROOM, 0, GFP_ATOMIC);
                if (!skb)
                        return false;
                kfree_skb(*_skb);