From df3741332d86629a8fdd267930e0a249803f6aa8 Mon Sep 17 00:00:00 2001 From: Loganaden Velvindron Date: Sun, 9 Nov 2014 06:15:05 -0800 Subject: extensions: libxt_TEE: Trim kernel struct to allow deletion 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 Signed-off-by: Pablo Neira Ayuso --- extensions/libxt_TEE.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extensions/libxt_TEE.c') diff --git a/extensions/libxt_TEE.c b/extensions/libxt_TEE.c index 92c7601c..66c060d3 100644 --- a/extensions/libxt_TEE.c +++ b/extensions/libxt_TEE.c @@ -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, -- cgit v1.2.3