[iptables PATCH 18/23] arptables: Fix jumps into user-defined chains

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

 



Trying to jump into a user-defined chain was not possible:

| arptables-nft -N foo
| arptables-nft -A INPUT -j foo
| (null) v1.8.0 (nf_tables):  RULE_APPEND failed (No such file or directory): rule in chain INPUT

Since nft_arp_add() already does the right thing if cs->target is NULL
and cs->jumpto contains a non-empty string, simply drop the block of
code trying to deal with the situation.

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 iptables/xtables-arp.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c
index 1132478878127..3afb2da3e8bbf 100644
--- a/iptables/xtables-arp.c
+++ b/iptables/xtables-arp.c
@@ -1413,17 +1413,6 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table)
 						opt2char(OPT_VIANAMEIN),
 						chain);
 		}
-
-		if (!cs.target && strlen(cs.jumpto) != 0) {
-			size_t size;
-
-			cs.target = xtables_find_target(XT_STANDARD_TARGET,
-							XTF_LOAD_MUST_SUCCEED);
-			size = sizeof(struct arpt_entry_target) + cs.target->size;
-			cs.target->t = xtables_calloc(1, size);
-			cs.target->t->u.target_size = size;
-			strcpy(cs.target->t->u.user.name, cs.jumpto);
-		}
 	}
 
 	switch (command) {
-- 
2.18.0

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