From nobody Tue Feb 22 22:39:50 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3EF6119E18FA; Tue, 22 Feb 2022 22:39:51 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K3Dd31L6hz3Kn1; Tue, 22 Feb 2022 22:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645569591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YWKN3lepyGpeN63hga4wDeJTNyey/bOjR0KsfWY42Ck=; b=HKEswGVXMdWmHLS6LTwojf3Tkk0aRb/63KLi9TZ2Zq4+EETokhsqBK9x1sG2lQB6+v5bjH zeioitnYp6rOq5ewT3fSVe1Ixpg9z1HNVO8R6EsgdIBZ02ORpLkauAXrx3kibZZTr61wKV cjKJvRiKlnQz1NyVZOWrI14h9eNMI8K0iG791tIrfT3TrMM2x7gS+FVI/bMPpNF3yTKMoh 26NFtSW/1ibwDFHZyGkCh2N/QDybrJI9jdheyeD7kT2AWBLAfSwztBeUbCEHQ2DpIQJm61 P9WKM45bxneDj3KXymsyGQNUTA0jIDpL7t+/ULfCo0n9/7D03fp66cNPE3TjtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E19F4D8C; Tue, 22 Feb 2022 22:39:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21MMdoOH042358; Tue, 22 Feb 2022 22:39:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21MMdoed042357; Tue, 22 Feb 2022 22:39:50 GMT (envelope-from git) Date: Tue, 22 Feb 2022 22:39:50 GMT Message-Id: <202202222239.21MMdoed042357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: e02d28a7bb86 - stable/13 - sctp: minor cleanups, no functional change intended List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e02d28a7bb8633591246f973a3248e91aab328b3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645569591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YWKN3lepyGpeN63hga4wDeJTNyey/bOjR0KsfWY42Ck=; b=SpKKDRpntSs6Ub6Fs482BdXljpOuNtKSDh8reOZeeklsxQDMKcW/h8tPcJyKnj0XldONRw qoRrZLGOy7oOFDVW2WvY7TtDTtkwwSdUwtl0a0PJPOQ3vDPK0lRTnXCxAV02wzMRqwutfp RfWJQR9bzPPCNa+MEDMhpXs75bUXWXyNAvpQnB2naLU+BaEfwrQtyKPUnBoaDDZqZ9gg9C +UxjYzf6h6wRzF/VwYCxU9AiCrSUT6fUxTFFjCl0cCm46aabmRSYWth5R8mpo/X0feQVeG jwWZ7BOnmL5NzX92gctHJq+Z3vuydyOUAHs3SJqn0mTdtLH6K8YkcEGfp+x51g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645569591; a=rsa-sha256; cv=none; b=PaGD5dQ1shWJcjkAZfQtK0NyhECkmo2tdBYAxAZpezD2u9ANJ3CikJ6XmHG5D1UWTwnIHT GWia/jR/gWlKUa1vosVCDEr5nWouLxRDvfI/2oB+EV+hb3kjRijjXuFGBuPrzfd6I44uH1 MW0vmEWmKgqGtgNnlDbgvOMPQ7w7GZKVXjasegdPQqDpAGZjbz0Vn7tcWcOhchsi/37elO I0x2nj5nbHOO0Xi4csKd55UNBnjrG2+7WEiBQnigzJtRvl5942kBNlxzzf2HGtld6deHO4 LIFXYE8PVFLmYah0TNOePVP+fFgUni5Ok1K1BtPbWdEM+uQfnfBXn+XRj9Pv9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e02d28a7bb8633591246f973a3248e91aab328b3 commit e02d28a7bb8633591246f973a3248e91aab328b3 Author: Michael Tuexen AuthorDate: 2021-09-08 13:13:05 +0000 Commit: Michael Tuexen CommitDate: 2022-02-22 22:39:26 +0000 sctp: minor cleanups, no functional change intended (cherry picked from commit aab1d593b2ec2c24a808eed39c39890b066d5fba) --- sys/netinet/sctp_input.c | 4 ++-- sys/netinet/sctp_output.c | 6 +++--- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/sctp_timer.c | 12 ++++++------ sys/netinet/sctp_usrreq.c | 6 +++--- sys/netinet/sctputil.c | 16 ++++++++-------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 60439cf2f9e8..b257a62e02f8 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -2444,10 +2444,10 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, if ((uint32_t)diff.tv_sec > UINT32_MAX / 1000000) { staleness = UINT32_MAX; } else { - staleness = diff.tv_sec * 1000000; + staleness = (uint32_t)diff.tv_sec * 1000000; } if (UINT32_MAX - staleness >= (uint32_t)diff.tv_usec) { - staleness += diff.tv_usec; + staleness += (uint32_t)diff.tv_usec; } else { staleness = UINT32_MAX; } diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 4fa2e8045258..de9b1e129280 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -11328,7 +11328,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked) /* Fill out hb parameter */ hb->heartbeat.hb_info.ph.param_type = htons(SCTP_HEARTBEAT_INFO); hb->heartbeat.hb_info.ph.param_length = htons(sizeof(struct sctp_heartbeat_info_param)); - hb->heartbeat.hb_info.time_value_1 = now.tv_sec; + hb->heartbeat.hb_info.time_value_1 = (uint32_t)now.tv_sec; hb->heartbeat.hb_info.time_value_2 = now.tv_usec; /* Did our user request this one, put it in */ hb->heartbeat.hb_info.addr_family = (uint8_t)net->ro._l_addr.sa.sa_family; @@ -12847,7 +12847,7 @@ sctp_lower_sosend(struct socket *so, SCTP_TCB_UNLOCK(stcb); hold_tcblock = 0; } else { - atomic_add_int(&stcb->asoc.sb_send_resv, sndlen); + atomic_add_int(&stcb->asoc.sb_send_resv, (int)sndlen); } local_soresv = sndlen; if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { @@ -13684,7 +13684,7 @@ out: out_unlocked: if (local_soresv && stcb) { - atomic_subtract_int(&stcb->asoc.sb_send_resv, sndlen); + atomic_subtract_int(&stcb->asoc.sb_send_resv, (int)sndlen); } if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index afca21d36125..a2e0853916a9 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2576,7 +2576,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) /* Setup the initial secret */ (void)SCTP_GETTIME_TIMEVAL(&time); - m->time_of_secret_change = time.tv_sec; + m->time_of_secret_change = (unsigned int)time.tv_sec; for (i = 0; i < SCTP_NUMBER_OF_SECRETS; i++) { m->secret_key[0][i] = sctp_select_initial_TSN(m); diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 2d3836829e89..4866356bdf5c 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -542,8 +542,8 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb, min_wait.tv_sec = min_wait.tv_usec = 0; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { - sctp_log_fr(cur_rto, now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); - sctp_log_fr(0, min_wait.tv_sec, min_wait.tv_usec, SCTP_FR_T3_MARK_TIME); + sctp_log_fr(cur_rto, (uint32_t)now.tv_sec, now.tv_usec, SCTP_FR_T3_MARK_TIME); + sctp_log_fr(0, (uint32_t)min_wait.tv_sec, min_wait.tv_usec, SCTP_FR_T3_MARK_TIME); } /* * Our rwnd will be incorrect here since we are not adding back the @@ -590,7 +590,7 @@ start_again: /* validate its been outstanding long enough */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(chk->rec.data.tsn, - chk->sent_rcv_time.tv_sec, + (uint32_t)chk->sent_rcv_time.tv_sec, chk->sent_rcv_time.tv_usec, SCTP_FR_T3_MARK_TIME); } @@ -602,7 +602,7 @@ start_again: */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(0, - chk->sent_rcv_time.tv_sec, + (uint32_t)chk->sent_rcv_time.tv_sec, chk->sent_rcv_time.tv_usec, SCTP_FR_T3_STOPPED); } @@ -853,11 +853,11 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, if (net != stcb->asoc.primary_destination) { /* send a immediate HB if our RTO is stale */ struct timeval now; - unsigned int ms_goneby; + uint32_t ms_goneby; (void)SCTP_GETTIME_TIMEVAL(&now); if (net->last_sent_time.tv_sec) { - ms_goneby = (now.tv_sec - net->last_sent_time.tv_sec) * 1000; + ms_goneby = (uint32_t)(now.tv_sec - net->last_sent_time.tv_sec) * 1000; } else { ms_goneby = 0; } diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 2dad0b41a304..c7cbc9fc682c 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -2755,7 +2755,7 @@ flags_out: sasoc->sasoc_asocmaxrxt = inp->sctp_ep.max_send_times; sasoc->sasoc_number_peer_destinations = 0; sasoc->sasoc_peer_rwnd = 0; - sasoc->sasoc_local_rwnd = sbspace(&inp->sctp_socket->so_rcv); + sasoc->sasoc_local_rwnd = (uint32_t)sbspace(&inp->sctp_socket->so_rcv); SCTP_INP_RUNLOCK(inp); } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -2856,7 +2856,7 @@ flags_out: { struct sctp_hmacalgo *shmac; sctp_hmaclist_t *hmaclist; - uint32_t size; + size_t size; int i; SCTP_CHECK_AND_CAST(shmac, optval, struct sctp_hmacalgo, *optsize); @@ -2872,7 +2872,7 @@ flags_out: /* is there room for all of the hmac ids? */ size = sizeof(*shmac) + (hmaclist->num_algo * sizeof(shmac->shmac_idents[0])); - if ((size_t)(*optsize) < size) { + if (*optsize < size) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; SCTP_INP_RUNLOCK(inp); diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 7d6b932b4dc1..4ec801ce25d7 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1936,7 +1936,7 @@ sctp_timeout_handler(void *t) type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timosecret); (void)SCTP_GETTIME_TIMEVAL(&tv); - inp->sctp_ep.time_of_secret_change = tv.tv_sec; + inp->sctp_ep.time_of_secret_change = (unsigned int)tv.tv_sec; inp->sctp_ep.last_secret_number = inp->sctp_ep.current_secret_number; inp->sctp_ep.current_secret_number++; @@ -6081,7 +6081,7 @@ get_more_data: copied_so_far += cp_len; freed_so_far += (uint32_t)cp_len; freed_so_far += MSIZE; - atomic_subtract_int(&control->length, cp_len); + atomic_subtract_int(&control->length, (int)cp_len); control->data = sctp_m_free(m); m = control->data; /* @@ -6123,10 +6123,10 @@ get_more_data: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, (int)cp_len); } - atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); + atomic_subtract_int(&so->so_rcv.sb_cc, (int)cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { - atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); + atomic_subtract_int(&stcb->asoc.sb_cc, (int)cp_len); } copied_so_far += cp_len; freed_so_far += (uint32_t)cp_len; @@ -6135,7 +6135,7 @@ get_more_data: sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } - atomic_subtract_int(&control->length, cp_len); + atomic_subtract_int(&control->length, (int)cp_len); } else { copied_so_far += cp_len; } @@ -6233,9 +6233,9 @@ get_more_data: } /* * We need to wait for more data a few things: - We don't - * release the I/O lock so we don't get someone else reading. - * - We must be sure to account for the case where what is added - * is NOT to our control when we wakeup. + * release the I/O lock so we don't get someone else + * reading. - We must be sure to account for the case where + * what is added is NOT to our control when we wakeup. */ /*