summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2016-04-01 14:05:48 -0300
committerDavid S. Miller <davem@davemloft.net>2016-04-05 15:39:44 -0400
commite43569e6d3c71eb266641c6297ea54f7ac66954f (patch)
tree7104bb69c8ffba181f3c296aa1534bc11bddd5fc
parentc862cc9b70526a71d07e7bd86d9b61d1c792cead (diff)
downloadlinux-stable-e43569e6d3c71eb266641c6297ea54f7ac66954f.tar.gz
linux-stable-e43569e6d3c71eb266641c6297ea54f7ac66954f.tar.bz2
linux-stable-e43569e6d3c71eb266641c6297ea54f7ac66954f.zip
sctp: flush if we can't fit another DATA chunk
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>
-rw-r--r--net/sctp/output.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 97745351d58c..9844fe573029 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -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;