1. 31 10月, 2020 1 次提交
    • X
      sctp: allow changing transport encap_port by peer packets · a1dd2cf2
      Xin Long 提交于
      As rfc6951#section-5.4 says:
      
        "After finding the SCTP association (which
         includes checking the verification tag), the UDP source port MUST be
         stored as the encapsulation port for the destination address the SCTP
         packet is received from (see Section 5.1).
      
         When a non-encapsulated SCTP packet is received by the SCTP stack,
         the encapsulation of outgoing packets belonging to the same
         association and the corresponding destination address MUST be
         disabled."
      
      transport encap_port should be updated by a validated incoming packet's
      udp src port.
      
      We save the udp src port in sctp_input_cb->encap_port, and then update
      the transport in two places:
      
        1. right after vtag is verified, which is required by RFC, and this
           allows the existent transports to be updated by the chunks that
           can only be processed on an asoc.
      
        2. right before processing the 'init' where the transports are added,
           and this allows building a sctp over udp connection by client with
           the server not knowing the remote encap port.
      
        3. when processing ootb_pkt and creating the temporary transport for
           the reply pkt.
      
      Note that sctp_input_cb->header is removed, as it's not used any more
      in sctp.
      
      v1->v2:
        - Change encap_port as __be16 for sctp_input_cb.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Acked-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      a1dd2cf2
  2. 24 5月, 2019 1 次提交
  3. 20 11月, 2018 1 次提交
  4. 18 10月, 2018 1 次提交
  5. 02 5月, 2018 1 次提交
  6. 26 4月, 2018 1 次提交
  7. 15 3月, 2018 1 次提交
  8. 16 12月, 2017 1 次提交
  9. 12 12月, 2017 4 次提交
  10. 29 10月, 2017 1 次提交
  11. 25 10月, 2017 1 次提交
  12. 12 8月, 2017 5 次提交
  13. 07 8月, 2017 3 次提交
  14. 02 7月, 2017 2 次提交
  15. 13 3月, 2017 4 次提交
  16. 20 2月, 2017 5 次提交
  17. 10 2月, 2017 2 次提交
  18. 19 1月, 2017 3 次提交
    • X
      sctp: add stream reconf primitive · 7a090b04
      Xin Long 提交于
      This patch is to add a primitive based on sctp primitive frame for
      sending stream reconf request. It works as the other primitives,
      and create a SCTP_CMD_REPLY command to send the request chunk out.
      
      sctp_primitive_RECONF would be the api to send a reconf request
      chunk.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a090b04
    • X
      sctp: add stream reconf timer · 7b9438de
      Xin Long 提交于
      This patch is to add a per transport timer based on sctp timer frame
      for stream reconf chunk retransmission. It would start after sending
      a reconf request chunk, and stop after receiving the response chunk.
      
      If the timer expires, besides retransmitting the reconf request chunk,
      it would also do the same thing with data RTO timer. like to increase
      the appropriate error counts, and perform threshold management, possibly
      destroying the asoc if sctp retransmission thresholds are exceeded, just
      as section 5.1.1 describes.
      
      This patch is also to add asoc strreset_chunk, it is used to save the
      reconf request chunk, so that it can be retransmitted, and to check if
      the response is really for this request by comparing the information
      inside with the response chunk as well.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7b9438de
    • X
      sctp: add support for generating stream reconf ssn reset request chunk · cc16f00f
      Xin Long 提交于
      This patch is to add asoc strreset_outseq and strreset_inseq for
      saving the reconf request sequence, initialize them when create
      assoc and process init, and also to define Incoming and Outgoing
      SSN Reset Request Parameter described in rfc6525 section 4.1 and
      4.2, As they can be in one same chunk as section rfc6525 3.1-3
      describes, it makes them in one function.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc16f00f
  19. 23 9月, 2016 1 次提交
    • M
      sctp: improve how SSN, TSN and ASCONF serial are compared · 182691d0
      Marcelo Ricardo Leitner 提交于
      Make it similar to time_before() macros:
      - easier to understand
      - make use of typecheck() to avoid working on unexpected variable types
        (made the issue on previous patch visible)
      - for _[lg]te versions, slighly faster, as the compiler used to generate
        a sequence of cmp/je/cmp/js instructions and now it's sub/test/jle
        (for _lte):
      
      Before, for sctp_outq_sack:
      	if (primary->cacc.changeover_active) {
          1f01:	80 b9 84 02 00 00 00 	cmpb   $0x0,0x284(%rcx)
          1f08:	74 6e                	je     1f78 <sctp_outq_sack+0xe8>
      		u8 clear_cycling = 0;
      
      		if (TSN_lte(primary->cacc.next_tsn_at_change, sack_ctsn)) {
          1f0a:	8b 81 80 02 00 00    	mov    0x280(%rcx),%eax
      	return ((s) - (t)) & TSN_SIGN_BIT;
      }
      
      static inline int TSN_lte(__u32 s, __u32 t)
      {
      	return ((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT);
          1f10:	8b 7d bc             	mov    -0x44(%rbp),%edi
          1f13:	39 c7                	cmp    %eax,%edi
          1f15:	74 25                	je     1f3c <sctp_outq_sack+0xac>
          1f17:	39 f8                	cmp    %edi,%eax
          1f19:	78 21                	js     1f3c <sctp_outq_sack+0xac>
      			primary->cacc.changeover_active = 0;
      
      After:
      	if (primary->cacc.changeover_active) {
          1ee7:	80 b9 84 02 00 00 00 	cmpb   $0x0,0x284(%rcx)
          1eee:	74 73                	je     1f63 <sctp_outq_sack+0xf3>
      		u8 clear_cycling = 0;
      
      		if (TSN_lte(primary->cacc.next_tsn_at_change, sack_ctsn)) {
          1ef0:	8b 81 80 02 00 00    	mov    0x280(%rcx),%eax
          1ef6:	2b 45 b4             	sub    -0x4c(%rbp),%eax
          1ef9:	85 c0                	test   %eax,%eax
          1efb:	7e 26                	jle    1f23 <sctp_outq_sack+0xb3>
      			primary->cacc.changeover_active = 0;
      
      *_lt() generated pretty much the same code.
      Tested with gcc (GCC) 6.1.1 20160621.
      
      This patch also removes SSN_lte as it is not used and cleanups some
      comments.
      Signed-off-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      182691d0
  20. 17 9月, 2016 1 次提交