From 9a47ea4b683dd845ec94534fcd82d3117c9ab313 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 7 Mar 2023 21:50:12 +0100 Subject: [PATCH] map: fix return code check for bpf_map_get_next_key calls It can now apparently return -2 instead of -1. Fixes an infinite loop on startup Signed-off-by: Felix Fietkau --- map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map.c b/map.c index 4b38155..4785cc5 100644 --- a/map.c +++ b/map.c @@ -142,7 +142,7 @@ static void qosify_map_clear_list(enum qosify_map_id id) int fd = qosify_map_fds[id]; __u32 key[4] = {}; - while (bpf_map_get_next_key(fd, &key, &key) != -1) + while (bpf_map_get_next_key(fd, &key, &key) == 0) bpf_map_delete_elem(fd, &key); } -- 2.30.2