2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

sflow: Use uint32_t instead of time_t for tick handling in the poller.

The sFlow library uses a uint32_t to configure timeout ticks, but
stores this value as a time_t. Although this doesn't cause functional
issues, it wastes space and confuses Coverity, potentially indicating
a Y2K38 problem when storing uint32_t values in time_t. This patch
updates the internal data structures to use uint32_t variables.

Fixes: c72e245a0e ("Add InMon's sFlow Agent library to the build system.")
Acked-by: Mike Pattrick <mkp@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
This commit is contained in:
Eelco Chaudron
2024-05-29 12:53:29 +02:00
parent e42d3ed298
commit 11e48b8ca2

View File

@@ -148,7 +148,7 @@ typedef struct _SFLPoller {
/* MIB fields */
SFLDataSource_instance dsi;
u_int32_t sFlowCpReceiver;
time_t sFlowCpInterval;
u_int32_t sFlowCpInterval;
/* public fields */
struct _SFLAgent *agent; /* pointer to my agent */
void *magic; /* ptr to pass back in getCountersFn() */
@@ -156,7 +156,7 @@ typedef struct _SFLPoller {
u_int32_t bridgePort; /* port number local to bridge */
/* private fields */
SFLReceiver *myReceiver;
time_t countersCountdown;
u_int32_t countersCountdown;
u_int32_t countersSampleSeqNo;
} SFLPoller;