]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
mnl: Fix ordering of hooks in 'list hooks' output
authorPhil Sutter <phil@nwl.cc>
Fri, 20 Mar 2026 12:30:52 +0000 (13:30 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 20 Mar 2026 15:30:54 +0000 (16:30 +0100)
Hooks with same family, basehook and priority were inadvertently
inserted into the list in reverse ordering, fix that.

Suggested-by: Florian Westphal <fw@strlen.de>
Fixes: b98fee20bfe23 ("mnl: revisit hook listing")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/mnl.c

index 4893af8322ae63a6243399615c78e86283433e78..b9efd3cfd3cea31df9596dc3ce3179db5089da0d 100644 (file)
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -2520,7 +2520,7 @@ static void basehook_list_add_tail(struct basehook *b, struct list_head *head)
                        continue;
                if (!basehook_eq(hook, b))
                        continue;
-               if (hook->prio < b->prio)
+               if (hook->prio <= b->prio)
                        continue;
 
                list_add(&b->list, &hook->list);