Add NANO_TO_SEC constant.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#define MAX_FILTERS 80
|
||||
#define MAX_TRACK_IPS 100000
|
||||
#define MAX_CPUS 256
|
||||
#define NANO_TO_SEC 1000000000
|
||||
|
||||
#ifdef __BPF__
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
|
||||
@@ -202,7 +202,7 @@ int xdp_prog_main(struct xdp_md *ctx)
|
||||
if (ip_stats)
|
||||
{
|
||||
// Check for reset.
|
||||
if ((now - ip_stats->tracking) > 1000000000)
|
||||
if ((now - ip_stats->tracking) > NANO_TO_SEC)
|
||||
{
|
||||
ip_stats->pps = 0;
|
||||
ip_stats->bps = 0;
|
||||
|
||||
Reference in New Issue
Block a user