Less effecient, but much, much less naive rate-limiter
[flowspec-xdp] / xdp.c
diff --git a/xdp.c b/xdp.c
index d9aa0766f75efdec39aecb191c4a176d2ce1d862..8003b89e0066b4311fd8eb482a922718914166e4 100644 (file)
--- a/xdp.c
+++ b/xdp.c
@@ -165,8 +165,8 @@ struct bpf_map_def SEC("maps") drop_cnt_map = {
 #ifdef RATE_CNT
 struct ratelimit {
        struct bpf_spin_lock lock;
-       uint64_t bucket_secs;
-       uint64_t bucket_count;
+       int64_t sent_bytes;
+       int64_t sent_time;
 };
 struct {
        __uint(type, BPF_MAP_TYPE_ARRAY);