sctp: flush if we can't fit another DATA chunk
[cascardo/linux.git] / net / sctp / output.c
index 9774535..9844fe5 100644 (file)
@@ -705,7 +705,8 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet,
        /* Check whether this chunk and all the rest of pending data will fit
         * or delay in hopes of bundling a full sized packet.
         */
-       if (chunk->skb->len + q->out_qlen >= transport->pathmtu - packet->overhead)
+       if (chunk->skb->len + q->out_qlen >
+               transport->pathmtu - packet->overhead - sizeof(sctp_data_chunk_t) - 4)
                /* Enough data queued to fill a packet */
                return SCTP_XMIT_OK;