]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
arptables: Fix jumps into user-defined chains
authorPhil Sutter <phil@nwl.cc>
Thu, 2 Aug 2018 15:05:23 +0000 (17:05 +0200)
committerFlorian Westphal <fw@strlen.de>
Sat, 4 Aug 2018 21:19:25 +0000 (23:19 +0200)
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@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
iptables/xtables-arp.c

index 4e29180934dc51bf62ecbd594d8ba6fdff4a1ec3..28f449e857411a08f29ed046093e7dc63c5f7bfd 100644 (file)
@@ -1387,17 +1387,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) {