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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Correct trimming of userspacesize to fix deletions.

Signed-off-by: Loganaden Velvindron <logan@xxxxxxxxxxxx>
---

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(-)

diff --git a/extensions/libxt_TEE.c b/extensions/libxt_TEE.c
index 92c7601..66c060d 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,
-- 
2.1.3
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux