Skip to content

Commit

Permalink
sctp: flush if we can't fit another DATA chunk
Browse files Browse the repository at this point in the history
There is no point on delaying the packet if we can't fit a single byte
of data on it anymore. So lets just reduce the threshold by the amount
that a data chunk with 4 bytes (rounding) would use.

v2: based on the right tree

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
marceloleitner authored and davem330 committed Apr 5, 2016
1 parent c862cc9 commit e43569e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sctp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e43569e

Please sign in to comment.