Skip to content

Commit 0d18779

Browse files
ppiaoummakynes
authored andcommitted
netfilter: nf_tables: fix update chain error
# nft add table filter # nft add chain filter c1 # nft rename chain filter c1 c2 Error: Could not process rule: No such file or directory rename chain filter c1 c2 ^^^^^^^^^^^^^^^^^^^^^^^^^^ # nft add chain filter c2 # nft rename chain filter c1 c2 # nft list table filter table ip filter { chain c2 { } chain c2 { } } Fixes: 664b0f8 ("netfilter: nf_tables: add generation mask to chains") Signed-off-by: JingPiao Chen <chenjingpiao@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent e517341 commit 0d18779

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,8 +1487,8 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
14871487

14881488
chain2 = nf_tables_chain_lookup(table, nla[NFTA_CHAIN_NAME],
14891489
genmask);
1490-
if (IS_ERR(chain2))
1491-
return PTR_ERR(chain2);
1490+
if (!IS_ERR(chain2))
1491+
return -EEXIST;
14921492
}
14931493

14941494
if (nla[NFTA_CHAIN_COUNTERS]) {

0 commit comments

Comments
 (0)