From owner-svn-src-all@freebsd.org Thu Mar 19 18:55:57 2020 Return-Path: Delivered-To: svn-src-all@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 8474C26E41B; Thu, 19 Mar 2020 18:55:57 +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) server-signature RSA-PSS (4096 bits) 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 48jx240FqGz4TxY; Thu, 19 Mar 2020 18:55:56 +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 23241F7C9; Thu, 19 Mar 2020 18:55:55 +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 02JIts8H002933; Thu, 19 Mar 2020 18:55:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02JItsK1002930; Thu, 19 Mar 2020 18:55:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202003191855.02JItsK1002930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 19 Mar 2020 18:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359151 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 359151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2020 18:55:57 -0000 Author: tuexen Date: Thu Mar 19 18:55:54 2020 New Revision: 359151 URL: https://svnweb.freebsd.org/changeset/base/359151 Log: Cleanup the stream reset and asconf timer. MFC after: 1 week Modified: head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_timer.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Thu Mar 19 18:17:43 2020 (r359150) +++ head/sys/netinet/sctp_timer.c Thu Mar 19 18:55:54 2020 (r359151) @@ -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: head/sys/netinet/sctp_timer.h ============================================================================== --- head/sys/netinet/sctp_timer.h Thu Mar 19 18:17:43 2020 (r359150) +++ head/sys/netinet/sctp_timer.h Thu Mar 19 18:55:54 2020 (r359151) @@ -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: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Mar 19 18:17:43 2020 (r359150) +++ head/sys/netinet/sctputil.c Thu Mar 19 18:55:54 2020 (r359151) @@ -1939,7 +1939,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; }