summaryrefslogtreecommitdiffstats
path: root/src/netlink.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-04-24 01:05:11 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-04-24 01:11:50 +0200
commitb7c658fff3a41fa58fcbcd229e1b1f0f4be03b3c (patch)
tree6882674b77c0d47e9aad28c8f1488f0aa2d8bcc9 /src/netlink.c
parent2daca4fa257ad9a7a7dbb1e249e7c24451b4e717 (diff)
netlink: netlink_list_chains() callers always wants all existing chains
Remove dead code, callers always need this to dump all of the existing chains. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/netlink.c b/src/netlink.c
index d668fa8c..8e345536 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -711,7 +711,6 @@ int netlink_list_chains(struct netlink_ctx *ctx, const struct handle *h,
const struct location *loc)
{
struct nftnl_chain_list *chain_cache;
- struct chain *chain;
chain_cache = mnl_nft_chain_dump(ctx, h->family);
if (chain_cache == NULL) {
@@ -725,20 +724,7 @@ int netlink_list_chains(struct netlink_ctx *ctx, const struct handle *h,
nftnl_chain_list_foreach(chain_cache, list_chain_cb, ctx);
nftnl_chain_list_free(chain_cache);
- /* Caller wants all existing chains */
- if (h->chain == NULL)
- return 0;
-
- /* Check if this chain exists, otherwise return an error */
- list_for_each_entry(chain, &ctx->list, list) {
- if (strcmp(chain->handle.chain, h->chain) == 0)
- return 0;
- }
-
- return netlink_io_error(ctx, NULL,
- "Could not find chain `%s' in table `%s': %s",
- h->chain, h->table,
- strerror(ENOENT));
+ return 0;
}
int netlink_flush_chain(struct netlink_ctx *ctx, const struct cmd *cmd)