From owner-svn-src-stable-12@freebsd.org Sun Aug 23 21:57:25 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 824933CCAB8; Sun, 23 Aug 2020 21:57:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BZTd12Ymvz4bqS; Sun, 23 Aug 2020 21:57:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B379E265; Sun, 23 Aug 2020 21:57:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07NLvPNa079568; Sun, 23 Aug 2020 21:57:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07NLvOKi079565; Sun, 23 Aug 2020 21:57:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202008232157.07NLvOKi079565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 23 Aug 2020 21:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r364559 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 364559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Aug 2020 21:57:25 -0000 Author: tuexen Date: Sun Aug 23 21:57:24 2020 New Revision: 364559 URL: https://svnweb.freebsd.org/changeset/base/364559 Log: MFC r359151:: Cleanup the stream reset and asconf timer. Modified: stable/12/sys/netinet/sctp_timer.c stable/12/sys/netinet/sctp_timer.h stable/12/sys/netinet/sctputil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_timer.c ============================================================================== --- stable/12/sys/netinet/sctp_timer.c Sun Aug 23 21:55:34 2020 (r364558) +++ stable/12/sys/netinet/sctp_timer.c Sun Aug 23 21:57:24 2020 (r364559) @@ -1103,10 +1103,9 @@ sctp_cookie_timer(struct sctp_inpcb *inp, } int -sctp_strreset_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net) +sctp_strreset_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb) { - struct sctp_nets *alt; + struct sctp_nets *alt, *net; struct sctp_tmit_chunk *strrst = NULL, *chk = NULL; if (stcb->asoc.stream_reset_outstanding == 0) { @@ -1117,9 +1116,9 @@ sctp_strreset_timer(struct sctp_inpcb *inp, struct sct if (strrst == NULL) { return (0); } + net = strrst->whoTo; /* do threshold management */ - if (sctp_threshold_management(inp, stcb, strrst->whoTo, - stcb->asoc.max_send_times)) { + if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { /* Assoc is over */ return (1); } @@ -1127,9 +1126,8 @@ sctp_strreset_timer(struct sctp_inpcb *inp, struct sct * Cleared threshold management, now lets backoff the address and * select an alternate */ - sctp_backoff_on_timeout(stcb, strrst->whoTo, 1, 0, 0); - alt = sctp_find_alternate_net(stcb, strrst->whoTo, 0); - sctp_free_remote_addr(strrst->whoTo); + sctp_backoff_on_timeout(stcb, net, 1, 0, 0); + alt = sctp_find_alternate_net(stcb, net, 0); strrst->whoTo = alt; atomic_add_int(&alt->ref_count, 1); @@ -1154,6 +1152,8 @@ sctp_strreset_timer(struct sctp_inpcb *inp, struct sct */ sctp_move_chunks_from_net(stcb, net); } + sctp_free_remote_addr(net); + /* mark the retran info */ if (strrst->sent != SCTP_DATAGRAM_RESEND) sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); @@ -1161,7 +1161,7 @@ sctp_strreset_timer(struct sctp_inpcb *inp, struct sct strrst->flags |= CHUNK_FLAGS_FRAGMENT_OK; /* restart the timer */ - sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, inp, stcb, strrst->whoTo); + sctp_timer_start(SCTP_TIMER_TYPE_STRRESET, inp, stcb, alt); return (0); } @@ -1186,8 +1186,9 @@ sctp_asconf_timer(struct sctp_inpcb *inp, struct sctp_ if (asconf == NULL) { return (0); } + net = asconf->whoTo; /* do threshold management */ - if (sctp_threshold_management(inp, stcb, asconf->whoTo, + if (sctp_threshold_management(inp, stcb, net, stcb->asoc.max_send_times)) { /* Assoc is over */ return (1); @@ -1208,10 +1209,9 @@ sctp_asconf_timer(struct sctp_inpcb *inp, struct sctp_ * cleared threshold management, so now backoff the net and * select an alternate */ - sctp_backoff_on_timeout(stcb, asconf->whoTo, 1, 0, 0); - alt = sctp_find_alternate_net(stcb, asconf->whoTo, 0); + sctp_backoff_on_timeout(stcb, net, 1, 0, 0); + alt = sctp_find_alternate_net(stcb, net, 0); if (asconf->whoTo != alt) { - sctp_free_remote_addr(asconf->whoTo); asconf->whoTo = alt; atomic_add_int(&alt->ref_count, 1); } @@ -1248,6 +1248,8 @@ sctp_asconf_timer(struct sctp_inpcb *inp, struct sctp_ */ sctp_move_chunks_from_net(stcb, net); } + sctp_free_remote_addr(net); + /* mark the retran info */ if (asconf->sent != SCTP_DATAGRAM_RESEND) sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); Modified: stable/12/sys/netinet/sctp_timer.h ============================================================================== --- stable/12/sys/netinet/sctp_timer.h Sun Aug 23 21:55:34 2020 (r364558) +++ stable/12/sys/netinet/sctp_timer.h Sun Aug 23 21:57:24 2020 (r364559) @@ -50,12 +50,15 @@ sctp_find_alternate_net(struct sctp_tcb *, int sctp_t3rxt_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); + int sctp_t1init_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); + int sctp_shutdown_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); + int sctp_heartbeat_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); @@ -72,8 +75,7 @@ int sctp_shutdownack_timer(struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *); int -sctp_strreset_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net); + sctp_strreset_timer(struct sctp_inpcb *, struct sctp_tcb *); int sctp_asconf_timer(struct sctp_inpcb *, struct sctp_tcb *, Modified: stable/12/sys/netinet/sctputil.c ============================================================================== --- stable/12/sys/netinet/sctputil.c Sun Aug 23 21:55:34 2020 (r364558) +++ stable/12/sys/netinet/sctputil.c Sun Aug 23 21:57:24 2020 (r364559) @@ -1935,7 +1935,7 @@ sctp_timeout_handler(void *t) if ((stcb == NULL) || (inp == NULL)) { break; } - if (sctp_strreset_timer(inp, stcb, net)) { + if (sctp_strreset_timer(inp, stcb)) { /* no need to unlock on tcb its gone */ goto out_decr; }