]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_pknock: support Linux 6.16 timer API
authorJan Engelhardt <jengelh@inai.de>
Wed, 20 Aug 2025 08:30:49 +0000 (10:30 +0200)
committerJan Engelhardt <jengelh@inai.de>
Wed, 20 Aug 2025 08:31:53 +0000 (10:31 +0200)
pknock/xt_pknock.c:362:39: error: implicit declaration of function
"from_timer"; did you mean "mod_timer"? [-Wimplicit-function-declaration]

extensions/pknock/xt_pknock.c

index be435c4abde22e715a79bdb4329ae16c0c91829f..734e6f2faa099023b13713d8ec91a648cbc18a82 100644 (file)
@@ -359,7 +359,11 @@ has_logged_during_this_minute(const struct peer *peer)
 static void peer_gc(struct timer_list *tl)
 {
        unsigned int i;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
+       struct xt_pknock_rule *rule = timer_container_of(rule, tl, timer);
+#else
        struct xt_pknock_rule *rule = from_timer(rule, tl, timer);
+#endif
        struct peer *peer;
        struct list_head *pos, *n;