Fix/better handling of no-stats-tracking rules
[flowspec-xdp] / xdp.c
diff --git a/xdp.c b/xdp.c
index 62120d2ef52107511c5f4a4f245c666ef5d4dcb2..e63bec379ee143672211c59c9bb4aaab19af9c2a 100644 (file)
--- a/xdp.c
+++ b/xdp.c
@@ -151,7 +151,7 @@ struct xdp_md {
 static const int XDP_PASS = 0;
 static const int XDP_DROP = 1;
 
-static long drop_cnt_map[RULECNT + STATIC_RULE_CNT];
+static long drop_cnt_map[STATS_RULECNT + STATIC_RULE_CNT];
 #define INCREMENT_MATCH(reason) { drop_cnt_map[reason] += 1; drop_cnt_map[reason] += data_end - pktdata; }
 
 #else /* TEST */
@@ -164,7 +164,7 @@ struct match_counter {
 };
 struct {
        __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
-       __uint(max_entries, RULECNT + STATIC_RULE_CNT);
+       __uint(max_entries, STATS_RULECNT + STATIC_RULE_CNT);
        __u32 *key;
        struct match_counter *value;
 } drop_cnt_map SEC(".maps");