From fryasu: Trim kernel struct to allow deletion for TEE targets
PATCH 1/1 From fryasu: Trim kernel struct to allow deletion for TEE targets
Correct trimming of userspacesize to fix deletions.
Signed-off-by Loganaden Velvindron <[email protected]>
---
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
@@ -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
Quoted 1 line · Loganaden Velvindron
Correct trimming of userspacesize to fix deletions.
Applied, thanks Loganaden.