sctp: store heartbeat creation time as time_t

Reported by:	Coverity Scan
CID:		1493087
MFC after:	3 days
This commit is contained in:
Michael Tuexen 2024-05-10 20:40:15 +02:00
parent 42aeb8d490
commit b67716dd58
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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;