]> www.infradead.org Git - users/hch/dma-mapping.git/commitdiff
netfilter: xtables: fix typo causing some targets not to load on IPv6
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 20 Oct 2024 12:49:51 +0000 (14:49 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 21 Oct 2024 09:31:26 +0000 (11:31 +0200)
- There is no NFPROTO_IPV6 family for mark and NFLOG.
- TRACE is also missing module autoload with NFPROTO_IPV6.

This results in ip6tables failing to restore a ruleset. This issue has been
reported by several users providing incomplete patches.

Very similar to Ilya Katsnelson's patch including a missing chunk in the
TRACE extension.

Fixes: 0bfcb7b71e73 ("netfilter: xtables: avoid NFPROTO_UNSPEC where needed")
Reported-by: Ignat Korchagin <ignat@cloudflare.com>
Reported-by: Ilya Katsnelson <me@0upti.me>
Reported-by: Krzysztof Olędzki <ole@ans.pl>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/xt_NFLOG.c
net/netfilter/xt_TRACE.c
net/netfilter/xt_mark.c

index d80abd6ccaf8f71fa70605fef7edada827a19ceb..6dcf4bc7e30b2ae364a1cd9ac8df954a90905c52 100644 (file)
@@ -79,7 +79,7 @@ static struct xt_target nflog_tg_reg[] __read_mostly = {
        {
                .name       = "NFLOG",
                .revision   = 0,
-               .family     = NFPROTO_IPV4,
+               .family     = NFPROTO_IPV6,
                .checkentry = nflog_tg_check,
                .destroy    = nflog_tg_destroy,
                .target     = nflog_tg,
index f3fa4f11348cd8ad796ce94f012cd48aa7a9020f..a642ff09fc8e8cff04fb53b9a6c97b10d68d1bad 100644 (file)
@@ -49,6 +49,7 @@ static struct xt_target trace_tg_reg[] __read_mostly = {
                .target         = trace_tg,
                .checkentry     = trace_tg_check,
                .destroy        = trace_tg_destroy,
+               .me             = THIS_MODULE,
        },
 #endif
 };
index f76fe04fc9a4e19f18ac323349ba6f22a00eafd7..65b965ca40ea7ea5d9feff381b433bf267a424c4 100644 (file)
@@ -62,7 +62,7 @@ static struct xt_target mark_tg_reg[] __read_mostly = {
        {
                .name           = "MARK",
                .revision       = 2,
-               .family         = NFPROTO_IPV4,
+               .family         = NFPROTO_IPV6,
                .target         = mark_tg,
                .targetsize     = sizeof(struct xt_mark_tginfo2),
                .me             = THIS_MODULE,