aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@fh-muenster.de>2020-03-27 22:55:48 +0100
committerMichael Tuexen <tuexen@fh-muenster.de>2020-03-27 22:55:48 +0100
commite53206da6c1447ac43eb5db278fc95646197fc6c (patch)
tree7cdc1ee6989defe9ef5486d93004836e12316623
parentbaeaf40ffbb561361bf5e9ca7a793b4dd37a2009 (diff)
downloadusrsctp-e53206da6c1447ac43eb5db278fc95646197fc6c.tar.gz
More uint32_t cleanups.
-rwxr-xr-xusrsctplib/netinet/sctp_pcb.h12
-rwxr-xr-xusrsctplib/netinet/sctp_structs.h4
-rwxr-xr-xusrsctplib/netinet/sctp_timer.c13
3 files changed, 14 insertions, 15 deletions
diff --git a/usrsctplib/netinet/sctp_pcb.h b/usrsctplib/netinet/sctp_pcb.h
index 2d18eaff..fbc80228 100755
--- a/usrsctplib/netinet/sctp_pcb.h
+++ b/usrsctplib/netinet/sctp_pcb.h
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.h 359357 2020-03-27 11:08:11Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.h 359379 2020-03-27 21:48:52Z tuexen $");
#endif
#ifndef _NETINET_SCTP_PCB_H_
@@ -363,11 +363,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;
diff --git a/usrsctplib/netinet/sctp_structs.h b/usrsctplib/netinet/sctp_structs.h
index 413f80b4..a2ff34fd 100755
--- a/usrsctplib/netinet/sctp_structs.h
+++ b/usrsctplib/netinet/sctp_structs.h
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_structs.h 359357 2020-03-27 11:08:11Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_structs.h 359379 2020-03-27 21:48:52Z tuexen $");
#endif
#ifndef _NETINET_SCTP_STRUCTS_H_
@@ -1121,7 +1121,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;
diff --git a/usrsctplib/netinet/sctp_timer.c b/usrsctplib/netinet/sctp_timer.c
index 307c0ed6..5bdb1d91 100755
--- a/usrsctplib/netinet/sctp_timer.c
+++ b/usrsctplib/netinet/sctp_timer.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_timer.c 359195 2020-03-21 16:12:19Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_timer.c 359379 2020-03-27 21:48:52Z tuexen $");
#endif
#define _IP_VHL
@@ -1543,10 +1543,10 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
{
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;
@@ -1558,9 +1558,8 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
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
@@ -1603,7 +1602,7 @@ sctp_autoclose_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb)
* 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;