git: e1fb799d7d1a - stable/14 - sctp: store heartbeat creation time as time_t

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Sat, 03 Aug 2024 22:27:31 UTC
The branch stable/14 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=e1fb799d7d1a9e5122c7f55e21ae271341a63602

commit e1fb799d7d1a9e5122c7f55e21ae271341a63602
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-05-10 18:40:15 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-08-03 22:27:00 +0000

    sctp: store heartbeat creation time as time_t
    
    Reported by:    Coverity Scan
    CID:            1493087
    
    (cherry picked from commit b67716dd58b93f373523cf35373c56fcfad44b12)
---
 sys/netinet/sctp_header.h | 2 +-
 sys/netinet/sctp_output.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/sctp_header.h b/sys/netinet/sctp_header.h
index 9696c4e954ba..c9fd0341f83a 100644
--- a/sys/netinet/sctp_header.h
+++ b/sys/netinet/sctp_header.h
@@ -83,7 +83,7 @@ struct sctp_supported_addr_param {
 /* heartbeat info parameter */
 struct sctp_heartbeat_info_param {
 	struct sctp_paramhdr ph;
-	uint32_t time_value_1;
+	time_t time_value_1;
 	uint32_t time_value_2;
 	uint32_t random_value1;
 	uint32_t random_value2;
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index c146bda95c7c..cc8d017aba16 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -11427,7 +11427,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 = (uint32_t)now.tv_sec;
+	hb->heartbeat.hb_info.time_value_1 = 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;