From owner-svn-src-all@freebsd.org Tue Oct 6 11:08:54 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 1284342FD77; Tue, 6 Oct 2020 11:08:54 +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 4C5F8P6frrz4Lvt; Tue, 6 Oct 2020 11:08:53 +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 C380625D8A; Tue, 6 Oct 2020 11:08:53 +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 096B8rKd020953; Tue, 6 Oct 2020 11:08:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096B8rbo020950; Tue, 6 Oct 2020 11:08:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010061108.096B8rbo020950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Oct 2020 11:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366482 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366482 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.33 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: Tue, 06 Oct 2020 11:08:54 -0000 Author: tuexen Date: Tue Oct 6 11:08:52 2020 New Revision: 366482 URL: https://svnweb.freebsd.org/changeset/base/366482 Log: Remove dead stores reported by clang static code analysis MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctp_input.c Tue Oct 6 11:08:52 2020 (r366482) @@ -4116,7 +4116,6 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk * struct sctp_idata_chunk *idata_chunk; uint32_t bottle_bw, on_queue; uint32_t offset, chk_len; - uint16_t trunc_len; uint16_t pktdrp_len; uint8_t pktdrp_flags; @@ -4126,13 +4125,10 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk * pktdrp_len = ntohs(cp->ch.chunk_length); KASSERT(limit <= pktdrp_len, ("Inconsistent limit")); if (pktdrp_flags & SCTP_PACKET_TRUNCATED) { - trunc_len = ntohs(cp->trunc_len); - if (trunc_len <= pktdrp_len - sizeof(struct sctp_pktdrop_chunk)) { + if (ntohs(cp->trunc_len) <= pktdrp_len - sizeof(struct sctp_pktdrop_chunk)) { /* The peer plays games with us. */ return; } - } else { - trunc_len = 0; } limit -= sizeof(struct sctp_pktdrop_chunk); offset = 0; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctp_output.c Tue Oct 6 11:08:52 2020 (r366482) @@ -8793,7 +8793,7 @@ no_data_fill: * the top of the for, but just to make sure * I will reset these again here. */ - ctl_cnt = bundle_at = 0; + ctl_cnt = 0; continue; /* This takes us back to the * for() for the nets. */ } else { @@ -9392,7 +9392,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, uint32_t dmtu = 0; SCTP_TCB_LOCK_ASSERT(stcb); - tmr_started = ctl_cnt = bundle_at = error = 0; + tmr_started = ctl_cnt = 0; no_fragmentflg = 1; fwd_tsn = 0; *cnt_out = 0; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctp_pcb.c Tue Oct 6 11:08:52 2020 (r366482) @@ -4345,7 +4345,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd LIST_INSERT_HEAD(head, stcb, sctp_asocs); SCTP_INP_INFO_WUNLOCK(); - if ((err = sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { + if (sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC)) { /* failure.. memory error? */ if (asoc->strmout) { SCTP_FREE(asoc->strmout, SCTP_M_STRMO); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctputil.c Tue Oct 6 11:08:52 2020 (r366482) @@ -1725,7 +1725,6 @@ sctp_timeout_handler(void *t) net = (struct sctp_nets *)tmr->net; CURVNET_SET((struct vnet *)tmr->vnet); NET_EPOCH_ENTER(et); - did_output = 1; released_asoc_reference = false; #ifdef SCTP_AUDITING_ENABLED @@ -1994,7 +1993,6 @@ sctp_timeout_handler(void *t) op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Shutdown guard timer expired"); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); - did_output = true; /* no need to unlock on tcb its gone */ goto out_decr; case SCTP_TIMER_TYPE_AUTOCLOSE: @@ -2071,7 +2069,6 @@ sctp_timeout_handler(void *t) #ifdef INVARIANTS panic("Unknown timer type %d", type); #else - did_output = false; goto out; #endif } @@ -2155,7 +2152,6 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, s ("sctp_timer_start of type %d: inp = %p, stcb->sctp_ep %p", t_type, stcb, stcb->sctp_ep)); tmr = NULL; - to_ticks = 0; if (stcb != NULL) { SCTP_TCB_LOCK_ASSERT(stcb); } else if (inp != NULL) {