Check BPF stats map lookup result.

This commit is contained in:
gamemann
2021-12-06 16:37:39 +00:00
parent 5591f1ace7
commit ef996a6596

View File

@@ -494,11 +494,15 @@ int main(int argc, char *argv[])
{ {
__u32 key = 0; __u32 key = 0;
struct stats stats[cpus]; struct stats stats[cpus];
//memset(&stats, 0, sizeof(struct stats) * cpus);
__u64 allowed = 0; __u64 allowed = 0;
__u64 dropped = 0; __u64 dropped = 0;
bpf_map_lookup_elem(statsmap, &key, &stats); if (bpf_map_lookup_elem(statsmap, &key, &stats) != 0)
{
fprintf(stderr, "Error performing stats map lookup.\n");
}
for (int i = 0; i < cpus; i++) for (int i = 0; i < cpus; i++)
{ {