Skip to contentSkip to conversation

From fryasu: Trim kernel struct to allow deletion for TEE targets

PATCH Applied Loganaden Velvindron 2 participants 2 messages Nov 9, 2014 – Nov 10, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 From fryasu: Trim kernel struct to allow deletion for TEE targets

Correct trimming of userspacesize to fix deletions.

---

bz: 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.

I tested on the latest iptables from master and the issue is stil present.

The diff fixes the issue, feedback welcomed.

 extensions/libxt_TEE.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
extensions/libxt_TEE.c +2 -2
index 92c7601..66c060d 100644
@@ -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,
Signature · 1 line
2.1.3
maintainer Applied
#1 lore raw
Quoted 1 line · Loganaden Velvindron

Correct trimming of userspacesize to fix deletions.

Applied, thanks Loganaden.