]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: libxt_TEE: Trim kernel struct to allow deletion
authorLoganaden Velvindron <logan@elandsys.com>
Sun, 9 Nov 2014 14:15:05 +0000 (06:15 -0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 9 Nov 2014 15:53:11 +0000 (16:53 +0100)
Correct trimming of userspacesize to fix deletions.

Fixes: Bugzilla #884.
The rule having TEE target with '--oif' option cannot be deleted by iptables command.

  $ iptables -I INPUT -i foo -j TEE --gateway x.x.x.x --oif bar
  $ iptables -D INPUT -i foo -j TEE --gateway x.x.x.x --oif bar
  iptables: No chain/target/match by that name.

Signed-off-by: Loganaden Velvindron <logan@elandsys.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
extensions/libxt_TEE.c

index 92c7601c083de8f1e882309bd8dd76af1c3130ab..66c060d30303a68d53e512d8804e33a5d8f72697 100644 (file)
@@ -99,7 +99,7 @@ static struct xtables_target tee_tg_reg[] = {
                .revision      = 1,
                .family        = NFPROTO_IPV4,
                .size          = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
-               .userspacesize = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
+               .userspacesize = offsetof(struct xt_tee_tginfo, priv),
                .help          = tee_tg_help,
                .print         = tee_tg_print,
                .save          = tee_tg_save,
@@ -112,7 +112,7 @@ static struct xtables_target tee_tg_reg[] = {
                .revision      = 1,
                .family        = NFPROTO_IPV6,
                .size          = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
-               .userspacesize = XT_ALIGN(sizeof(struct xt_tee_tginfo)),
+               .userspacesize = offsetof(struct xt_tee_tginfo, priv),
                .help          = tee_tg_help,
                .print         = tee_tg6_print,
                .save          = tee_tg6_save,