diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2024-05-10 18:25:04 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2024-08-01 21:06:50 +0000 |
commit | 90f47ea0d6a5fe56953ecc8749a11126b874b51d (patch) | |
tree | 473f21b77a3b9ba08381c4a9000269704333c202 /sys/netinet/sctp_pcb.c | |
parent | e25611e8584178822a6587d74591db5557b5db69 (diff) |
sctp: store vtag expire time as time_t
Reported by: Coverity Scan
CID: 1492525
CID: 1493239
(cherry picked from commit 42aeb8d490fb7e8f4c9d27b3797179b861bd85e3)
Diffstat (limited to 'sys/netinet/sctp_pcb.c')
-rw-r--r-- | sys/netinet/sctp_pcb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 5d603a3f26d0..f3b51b796df0 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4540,7 +4540,7 @@ sctp_del_remote_addr(struct sctp_tcb *stcb, struct sockaddr *remaddr) } static bool -sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) +sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, time_t now) { struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; @@ -4562,7 +4562,7 @@ sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) } static void -sctp_set_vtag_block(struct sctp_timewait *vtag_block, uint32_t time, +sctp_set_vtag_block(struct sctp_timewait *vtag_block, time_t time, uint32_t tag, uint16_t lport, uint16_t rport) { vtag_block->tv_sec_at_expire = time; @@ -4577,13 +4577,13 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; struct timeval now; - uint32_t time; + time_t time; int i; bool set; SCTP_INP_INFO_WLOCK_ASSERT(); (void)SCTP_GETTIME_TIMEVAL(&now); - time = (uint32_t)now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); + time = now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = false; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { @@ -4595,7 +4595,7 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) continue; } if ((twait_block->vtag_block[i].v_tag != 0) && - (twait_block->vtag_block[i].tv_sec_at_expire < (uint32_t)now.tv_sec)) { + (twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { if (set) { /* Audit expires this guy */ sctp_set_vtag_block(twait_block->vtag_block + i, 0, 0, 0, 0); @@ -6726,7 +6726,7 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * return (false); } } - return (!sctp_is_in_timewait(tag, lport, rport, (uint32_t)now->tv_sec)); + return (!sctp_is_in_timewait(tag, lport, rport, now->tv_sec)); } static void |