remarkable-linux/net/sctp
Xin Long 8cd5c25f2d sctp: uncork the old asoc before changing to the new one
local_cork is used to decide if it should uncork asoc outq after processing
some cmds, and it is set when replying or sending msgs. local_cork should
always have the same value with current asoc q->cork in some way.

The thing is when changing to a new asoc by cmd SET_ASOC, local_cork may
not be consistent with the current asoc any more. The cmd seqs can be:

  SCTP_CMD_UPDATE_ASSOC (asoc)
  SCTP_CMD_REPLY (asoc)
  SCTP_CMD_SET_ASOC (new_asoc)
  SCTP_CMD_DELETE_TCB (new_asoc)
  SCTP_CMD_SET_ASOC (asoc)
  SCTP_CMD_REPLY (asoc)

The 1st REPLY makes OLD asoc q->cork and local_cork both are 1, and the cmd
DELETE_TCB clears NEW asoc q->cork and local_cork. After asoc goes back to
OLD asoc, q->cork is still 1 while local_cork is 0. The 2nd REPLY will not
set local_cork because q->cork is already set and it can't be uncorked and
sent out because of this.

To keep local_cork consistent with the current asoc q->cork, this patch is
to uncork the old asoc if local_cork is set before changing to the new one.

Note that the above cmd seqs will be used in the next patch when updating
asoc and handling errors in it.

Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-20 15:32:55 -04:00
..
associola.c sctp: no need to check assoc id before calling sctp_assoc_set_id 2017-06-10 16:23:31 -04:00
auth.c sctp: use IS_ENABLED() instead of checking for built-in or module 2016-09-10 21:19:11 -07:00
bind_addr.c sctp: not copying duplicate addrs to the assoc's bind address list 2016-12-20 14:15:45 -05:00
chunk.c sctp: define the member stream as an object instead of pointer in asoc 2017-06-02 13:56:26 -04:00
debug.c net: sctp: fix array overrun read on sctp_timer_tbl 2017-01-24 15:24:35 -05:00
endpointola.c sctp: add reconf_enable in asoc ep and netns 2017-01-18 14:55:10 -05:00
input.c sctp: fix ICMP processing if skb is non-linear 2017-05-26 14:40:46 -04:00
inqueue.c sctp: rename WORD_TRUNC/ROUND macros 2016-09-22 03:13:26 -04:00
ipv6.c sctp: do not inherit ipv6_{mc|ac|fl}_list from parent 2017-05-18 10:24:08 -04:00
Kconfig sctp: add the sctp_diag.c file 2016-04-15 17:29:36 -04:00
Makefile sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00
objcnt.c sctp: prepare asoc stream for stream reconf 2017-01-06 21:07:26 -05:00
offload.c net: use skb->csum_not_inet to identify packets needing crc32c 2017-05-19 19:21:29 -04:00
output.c networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
outqueue.c sctp: define the member stream as an object instead of pointer in asoc 2017-06-02 13:56:26 -04:00
primitive.c sctp: add stream reconf primitive 2017-01-18 14:55:10 -05:00
probe.c
proc.c sctp: use read_lock_bh in sctp_eps_seq_show 2017-06-10 16:22:26 -04:00
protocol.c net: Work around lockdep limitation in sockets that use sockets 2017-03-09 18:23:27 -08:00
sctp_diag.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-02 22:20:41 -04:00
sm_make_chunk.c net: manual clean code which call skb_put_[data:zero] 2017-06-20 13:30:15 -04:00
sm_sideeffect.c sctp: uncork the old asoc before changing to the new one 2017-06-20 15:32:55 -04:00
sm_statefuns.c networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
sm_statetable.c sctp: add reconf chunk event 2017-02-19 18:17:59 -05:00
socket.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-15 11:59:32 -04:00
stream.c sctp: merge sctp_stream_new and sctp_stream_init 2017-06-02 13:56:26 -04:00
sysctl.c sctp: add get and set sockopt for reconf_enable 2017-03-12 23:22:24 -07:00
transport.c sctp: get sock from transport in sctp_transport_update_pmtu 2017-04-05 07:20:06 -07:00
tsnmap.c
ulpevent.c networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
ulpqueue.c sctp: define the member stream as an object instead of pointer in asoc 2017-06-02 13:56:26 -04:00