summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJingPiao Chen <chenjingpiao@gmail.com>2017-09-23 12:10:44 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2017-09-29 14:34:36 +0300
commit0d18779be13766b33c69cbc26df38383598da373 (patch)
tree6bc2822d3aab912562efd4ba3026b0fd9902760e /net
parente5173418ac597cebe9f7a39adf10be470000b518 (diff)
downloadlinux-0d18779be13766b33c69cbc26df38383598da373.tar.xz
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: 664b0f8cd8 ("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>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_tables_api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 929927171426..f98ca8c6aa59 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1487,8 +1487,8 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
chain2 = nf_tables_chain_lookup(table, nla[NFTA_CHAIN_NAME],
genmask);
- if (IS_ERR(chain2))
- return PTR_ERR(chain2);
+ if (!IS_ERR(chain2))
+ return -EEXIST;
}
if (nla[NFTA_CHAIN_COUNTERS]) {