]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: change to save MSG_MORE flag into assoc
authorXin Long <lucien.xin@gmail.com>
Sun, 26 Mar 2017 16:21:15 +0000 (00:21 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Mar 2017 00:56:15 +0000 (17:56 -0700)
commite1bed9386f630c3e5c160decadc2ea3c3ec04236
treed2f56d5f76f94719818538d4a9194b69b5a50fba
parent3befc2625c38f2c82307bd7f4a826f26f60020cd
sctp: change to save MSG_MORE flag into assoc

David Laight noticed the support for MSG_MORE with datamsg->force_delay
didn't really work as we expected, as the first msg with MSG_MORE set
would always block the following chunks' dequeuing.

This Patch is to rewrite it by saving the MSG_MORE flag into assoc as
David Laight suggested.

asoc->force_delay is used to save MSG_MORE flag before a msg is sent.
All chunks in queue would not be sent out if asoc->force_delay is set
by the msg with MSG_MORE flag, until a new msg without MSG_MORE flag
clears asoc->force_delay.

Note that this change would not affect the flush is generated by other
triggers, like asoc->state != ESTABLISHED, queue size > pmtu etc.

v1->v2:
  Not clear asoc->force_delay after sending the msg with MSG_MORE flag.

Fixes: bfb42042d8f1 ("sctp: add support for MSG_MORE")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: David Laight <david.laight@aculab.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h
net/sctp/output.c
net/sctp/socket.c