]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: conntrack: Use the right callbacks
authorPhil Sutter <phil@nwl.cc>
Fri, 26 Jul 2024 11:41:52 +0000 (13:41 +0200)
committerPhil Sutter <phil@nwl.cc>
Sat, 27 Jul 2024 17:32:57 +0000 (19:32 +0200)
These version-agnostic conntrack match aliases emulating the 'state'
extension introduced by commit 0d70163162589 ("libxt_state: replace as
an alias to xt_conntrack") had incompatible print and save callbacks
assigned. These callbacks expected struct xt_state_info in match->data
which is incompatible to any of the actual xt_conntrack_mtinfo* structs
used.

Fixes: b28d4dcc9f555 ("iptables: state match incompatibilty across versions")
Signed-off-by: Phil Sutter <phil@nwl.cc>
extensions/libxt_conntrack.c

index ffbc7467bbf2e425fdb5137ba8bc01a93414c190..ccbf731de7c4df0504366a78e5b0e68f1b03529e 100644 (file)
@@ -1502,8 +1502,8 @@ static struct xtables_match conntrack_mt_reg[] = {
                .size          = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
                .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo1)),
                .help          = state_help,
-               .print         = state_print,
-               .save          = state_save,
+               .print         = conntrack1_mt4_print,
+               .save          = conntrack1_mt4_save,
                .x6_parse      = state_ct1_parse,
                .x6_options    = state_opts,
        },
@@ -1517,8 +1517,8 @@ static struct xtables_match conntrack_mt_reg[] = {
                .size          = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo2)),
                .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo2)),
                .help          = state_help,
-               .print         = state_print,
-               .save          = state_save,
+               .print         = conntrack2_mt_print,
+               .save          = conntrack2_mt_save,
                .x6_parse      = state_ct23_parse,
                .x6_options    = state_opts,
        },
@@ -1532,8 +1532,8 @@ static struct xtables_match conntrack_mt_reg[] = {
                .size          = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo3)),
                .userspacesize = XT_ALIGN(sizeof(struct xt_conntrack_mtinfo3)),
                .help          = state_help,
-               .print         = state_print,
-               .save          = state_save,
+               .print         = conntrack3_mt_print,
+               .save          = conntrack3_mt_save,
                .x6_parse      = state_ct23_parse,
                .x6_options    = state_opts,
                .xlate         = state_xlate,