svn commit: r364573 - stable/12/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Sun Aug 23 22:24:49 UTC 2020
Author: tuexen
Date: Sun Aug 23 22:24:46 2020
New Revision: 364573
URL: https://svnweb.freebsd.org/changeset/base/364573
Log:
MFC r359379:
Some more uint32_t cleanups, no functional change.
Modified:
stable/12/sys/netinet/sctp_pcb.h
stable/12/sys/netinet/sctp_structs.h
stable/12/sys/netinet/sctp_timer.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/netinet/sctp_pcb.h
==============================================================================
--- stable/12/sys/netinet/sctp_pcb.h Sun Aug 23 22:23:19 2020 (r364572)
+++ stable/12/sys/netinet/sctp_pcb.h Sun Aug 23 22:24:46 2020 (r364573)
@@ -273,11 +273,11 @@ struct sctp_pcb {
uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS];
unsigned int size_of_a_cookie;
- unsigned int sctp_timeoutticks[SCTP_NUM_TMRS];
- unsigned int sctp_minrto;
- unsigned int sctp_maxrto;
- unsigned int initial_rto;
- int initial_init_rto_max;
+ uint32_t sctp_timeoutticks[SCTP_NUM_TMRS];
+ uint32_t sctp_minrto;
+ uint32_t sctp_maxrto;
+ uint32_t initial_rto;
+ uint32_t initial_init_rto_max;
unsigned int sctp_sack_freq;
uint32_t sctp_sws_sender;
@@ -320,7 +320,7 @@ struct sctp_pcb {
uint32_t def_cookie_life;
/* defaults to 0 */
- int auto_close_time;
+ uint32_t auto_close_time;
uint32_t initial_sequence_debug;
uint32_t adaptation_layer_indicator;
uint8_t adaptation_layer_indicator_provided;
Modified: stable/12/sys/netinet/sctp_structs.h
==============================================================================
--- stable/12/sys/netinet/sctp_structs.h Sun Aug 23 22:23:19 2020 (r364572)
+++ stable/12/sys/netinet/sctp_structs.h Sun Aug 23 22:24:46 2020 (r364573)
@@ -275,7 +275,7 @@ struct sctp_nets {
int lastsa;
int lastsv;
uint64_t rtt; /* last measured rtt value in us */
- unsigned int RTO;
+ uint32_t RTO;
/* This is used for SHUTDOWN/SHUTDOWN-ACK/SEND or INIT timers */
struct sctp_timer rxt_timer;
@@ -1062,7 +1062,7 @@ struct sctp_association {
uint32_t heart_beat_delay;
/* autoclose */
- unsigned int sctp_autoclose_ticks;
+ uint32_t sctp_autoclose_ticks;
/* how many preopen streams we have */
unsigned int pre_open_streams;
@@ -1071,7 +1071,7 @@ struct sctp_association {
unsigned int max_inbound_streams;
/* the cookie life I award for any cookie, in seconds */
- unsigned int cookie_life;
+ uint32_t cookie_life;
/* time to delay acks for */
unsigned int delayed_ack;
unsigned int old_delayed_ack;
@@ -1080,10 +1080,10 @@ struct sctp_association {
unsigned int numduptsns;
int dup_tsns[SCTP_MAX_DUP_TSNS];
- unsigned int initial_init_rto_max; /* initial RTO for INIT's */
- unsigned int initial_rto; /* initial send RTO */
- unsigned int minrto; /* per assoc RTO-MIN */
- unsigned int maxrto; /* per assoc RTO-MAX */
+ uint32_t initial_init_rto_max; /* initial RTO for INIT's */
+ uint32_t initial_rto; /* initial send RTO */
+ uint32_t minrto; /* per assoc RTO-MIN */
+ uint32_t maxrto; /* per assoc RTO-MAX */
/* authentication fields */
sctp_auth_chklist_t *local_auth_chunks;
Modified: stable/12/sys/netinet/sctp_timer.c
==============================================================================
--- stable/12/sys/netinet/sctp_timer.c Sun Aug 23 22:23:19 2020 (r364572)
+++ stable/12/sys/netinet/sctp_timer.c Sun Aug 23 22:24:46 2020 (r364573)
@@ -1524,10 +1524,10 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sc
{
struct timeval tn, *tim_touse;
struct sctp_association *asoc;
- int ticks_gone_by;
+ uint32_t ticks_gone_by;
(void)SCTP_GETTIME_TIMEVAL(&tn);
- if (stcb->asoc.sctp_autoclose_ticks &&
+ if (stcb->asoc.sctp_autoclose_ticks > 0 &&
sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) {
/* Auto close is on */
asoc = &stcb->asoc;
@@ -1539,9 +1539,8 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sc
tim_touse = &asoc->time_last_sent;
}
/* Now has long enough transpired to autoclose? */
- ticks_gone_by = SEC_TO_TICKS(tn.tv_sec - tim_touse->tv_sec);
- if ((ticks_gone_by > 0) &&
- (ticks_gone_by >= (int)asoc->sctp_autoclose_ticks)) {
+ ticks_gone_by = SEC_TO_TICKS((uint32_t)(tn.tv_sec - tim_touse->tv_sec));
+ if (ticks_gone_by >= asoc->sctp_autoclose_ticks) {
/*
* autoclose time has hit, call the output routine,
* which should do nothing just to be SURE we don't
@@ -1584,7 +1583,7 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sc
* No auto close at this time, reset t-o to check
* later
*/
- int tmp;
+ uint32_t tmp;
/* fool the timer startup to use the time left */
tmp = asoc->sctp_autoclose_ticks;
More information about the svn-src-stable-12
mailing list