ports/net/ntopng/patches/patch-src_NetworkInterface_cpp

21 lines
920 B
Text

cope with openbsd nonstandard bpf_timeval
Index: src/NetworkInterface.cpp
--- src/NetworkInterface.cpp.orig
+++ src/NetworkInterface.cpp
@@ -1997,9 +1997,13 @@ bool NetworkInterface::processPacket(u_int32_t bridge_
(2) ensures that periodic_stats_update is not performed too frequently as it could be detrimental for performances and lead
to packet drops.
*/
+ timeval tmpt;
+ tmpt.tv_sec = when->tv_sec;
+ tmpt.tv_usec = when->tv_usec;
+
if(flow->get_current_bytes_cli2srv() + flow->get_current_bytes_srv2cli() >= PERIODIC_STATS_UPDATE_MIN_REFRESH_BYTES
- && Utils::msTimevalDiff(when, flow->get_current_update_time()) >= PERIODIC_STATS_UPDATE_MIN_REFRESH_MS) {
- flow->periodic_stats_update(when);
+ && Utils::msTimevalDiff(&tmpt, flow->get_current_update_time()) >= PERIODIC_STATS_UPDATE_MIN_REFRESH_MS) {
+ flow->periodic_stats_update(&tmpt);
}
return(pass_verdict);