Skip to content
  1. Nov 29, 2017
  2. Nov 28, 2017
  3. Nov 27, 2017
    • David S. Miller's avatar
      Merge branch 'sctp-stream-reconfig-fixes' · 6b56b1a2
      David S. Miller authored
      
      
      Xin Long says:
      
      ====================
      sctp: a bunch of fixes for stream reconfig
      
      This patchset is to make stream reset and asoc reset work more correctly
      for stream reconfig.
      
      Thank to Marcelo making them very clear.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b56b1a2
    • Xin Long's avatar
      sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1 · 52a39589
      Xin Long authored
      When doing asoc reset, if the sender of the response has already sent some
      chunk and increased asoc->next_tsn before the duplicate request comes, the
      response will use the old result with an incorrect sender next_tsn.
      
      Better than asoc->next_tsn, asoc->ctsn_ack_point can't be changed after
      the sender of the response has performed the asoc reset and before the
      peer has confirmed it, and it's value is still asoc->next_tsn original
      value minus 1.
      
      This patch sets sender next_tsn for the old result with ctsn_ack_point
      plus 1 when processing the duplicate request, to make sure the sender
      next_tsn value peer gets will be always right.
      
      Fixes: 692787ce
      
       ("sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      52a39589
    • Xin Long's avatar
      sctp: avoid flushing unsent queue when doing asoc reset · 159f2a74
      Xin Long authored
      
      
      Now when doing asoc reset, it cleans up sacked and abandoned queues
      by calling sctp_outq_free where it also cleans up unsent, retransmit
      and transmitted queues.
      
      It's safe for the sender of response, as these 3 queues are empty at
      that time. But when the receiver of response is doing the reset, the
      users may already enqueue some chunks into unsent during the time
      waiting the response, and these chunks should not be flushed.
      
      To void the chunks in it would be removed, it moves the queue into a
      temp list, then gets it back after sctp_outq_free is done.
      
      The patch also fixes some incorrect comments in
      sctp_process_strreset_tsnreq.
      
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      159f2a74
    • Xin Long's avatar
      sctp: only allow the asoc reset when the asoc outq is empty · 5c6144a0
      Xin Long authored
      As it says in rfc6525#section5.1.4, before sending the request,
      
         C2:  The sender has either no outstanding TSNs or considers all
              outstanding TSNs abandoned.
      
      Prior to this patch, it tried to consider all outstanding TSNs abandoned
      by dropping all chunks in all outqs with sctp_outq_free (even including
      sacked, retransmit and transmitted queues) when doing this reset, which
      is too aggressive.
      
      To make it work gently, this patch will only allow the asoc reset when
      the sender has no outstanding TSNs by checking if unsent, transmitted
      and retransmit are all empty with sctp_outq_is_empty before sending
      and processing the request.
      
      Fixes: 692787ce
      
       ("sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c6144a0