1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

Some more uint32_t cleanups, no functional change.

MFC after:		1 week
This commit is contained in:
Michael Tuexen 2020-03-27 21:48:52 +00:00
parent e4c8ad744a
commit d5d190f2f9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=359379
3 changed files with 11 additions and 12 deletions

View File

@ -273,11 +273,11 @@ struct sctp_pcb {
uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS]; uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS];
unsigned int size_of_a_cookie; unsigned int size_of_a_cookie;
unsigned int sctp_timeoutticks[SCTP_NUM_TMRS]; uint32_t sctp_timeoutticks[SCTP_NUM_TMRS];
unsigned int sctp_minrto; uint32_t sctp_minrto;
unsigned int sctp_maxrto; uint32_t sctp_maxrto;
unsigned int initial_rto; uint32_t initial_rto;
int initial_init_rto_max; uint32_t initial_init_rto_max;
unsigned int sctp_sack_freq; unsigned int sctp_sack_freq;
uint32_t sctp_sws_sender; uint32_t sctp_sws_sender;

View File

@ -1062,7 +1062,7 @@ struct sctp_association {
uint32_t heart_beat_delay; uint32_t heart_beat_delay;
/* autoclose */ /* autoclose */
unsigned int sctp_autoclose_ticks; uint32_t sctp_autoclose_ticks;
/* how many preopen streams we have */ /* how many preopen streams we have */
unsigned int pre_open_streams; unsigned int pre_open_streams;

View File

@ -1524,10 +1524,10 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
{ {
struct timeval tn, *tim_touse; struct timeval tn, *tim_touse;
struct sctp_association *asoc; struct sctp_association *asoc;
int ticks_gone_by; uint32_t ticks_gone_by;
(void)SCTP_GETTIME_TIMEVAL(&tn); (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)) { sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) {
/* Auto close is on */ /* Auto close is on */
asoc = &stcb->asoc; asoc = &stcb->asoc;
@ -1539,9 +1539,8 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
tim_touse = &asoc->time_last_sent; tim_touse = &asoc->time_last_sent;
} }
/* Now has long enough transpired to autoclose? */ /* Now has long enough transpired to autoclose? */
ticks_gone_by = SEC_TO_TICKS(tn.tv_sec - tim_touse->tv_sec); ticks_gone_by = SEC_TO_TICKS((uint32_t)(tn.tv_sec - tim_touse->tv_sec));
if ((ticks_gone_by > 0) && if (ticks_gone_by >= asoc->sctp_autoclose_ticks) {
(ticks_gone_by >= (int)asoc->sctp_autoclose_ticks)) {
/* /*
* autoclose time has hit, call the output routine, * autoclose time has hit, call the output routine,
* which should do nothing just to be SURE we don't * which should do nothing just to be SURE we don't
@ -1584,7 +1583,7 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
* No auto close at this time, reset t-o to check * No auto close at this time, reset t-o to check
* later * later
*/ */
int tmp; uint32_t tmp;
/* fool the timer startup to use the time left */ /* fool the timer startup to use the time left */
tmp = asoc->sctp_autoclose_ticks; tmp = asoc->sctp_autoclose_ticks;