@@ -6,6 +6,7 @@
*/
#include "sflow_api.h"
+#include "random.h"
/*_________________--------------------------__________________
_________________ sfl_poller_init __________________
@@ -88,7 +89,7 @@ void sfl_poller_set_sFlowCpInterval(SFLPoller *poller, u_int32_t sFlowCpInterval
Another smoothing factor is that the tick() function called here is usually
driven from a fairly "soft" polling loop rather than a hard real-time event.
*/
- poller->countersCountdown = 1 + (random() % sFlowCpInterval);
+ poller->countersCountdown = 1 + random_range(sFlowCpInterval);
}
else {
/* Setting sFlowCpInterval to 0 disables counter polling altogether. Thanks to
Coverity has flagged the use of a potentially unsafe function. Although this is not a concern in this case since it's not used for encryption, we should replace it with the OVS implementation to achieve better randomness. Fixes: c72e245a0e2c ("Add InMon's sFlow Agent library to the build system.") Signed-off-by: Eelco Chaudron <echaudro@redhat.com> --- lib/sflow_poller.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)