diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-01-19 17:43:56 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-01-23 14:27:36 +0100 |
commit | 04ccf3b2417ea17e1ec705cd6e442816e4eb4002 (patch) | |
tree | 919b89cf534d7b4336ee41194970e0870284b0e6 /src | |
parent | 1967b4f67cfbb64d12fc4953db35e3d7aa5f773e (diff) |
netlink: don't bail out on dump errors
This patch removes the existing error messages on netlink dump errors.
These functions used to be called from list commands. These days they
are called from the cache cache population path.
Note that nft breaks with older kernels at netlink_list_objs() since we
have no stateful objects support there.
Silence errors at this stage and return an empty list, thus, nft bails
out on explicit user commands if no nf_tables support is available.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/netlink.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/netlink.c b/src/netlink.c index 4135f251..73ee5c97 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -551,9 +551,7 @@ static int netlink_list_rules(struct netlink_ctx *ctx, const struct handle *h, if (errno == EINTR) return -1; - return netlink_io_error(ctx, loc, - "Could not receive rules from kernel: %s", - strerror(errno)); + return 0; } ctx->data = h; @@ -827,9 +825,7 @@ int netlink_list_chains(struct netlink_ctx *ctx, const struct handle *h, if (errno == EINTR) return -1; - return netlink_io_error(ctx, loc, - "Could not receive chains from kernel: %s", - strerror(errno)); + return 0; } ctx->data = h; @@ -1029,9 +1025,7 @@ int netlink_list_tables(struct netlink_ctx *ctx, const struct handle *h, if (errno == EINTR) return -1; - return netlink_io_error(ctx, loc, - "Could not receive tables from kernel: %s", - strerror(errno)); + return 0; } nftnl_table_list_foreach(table_cache, list_table_cb, ctx); @@ -1331,9 +1325,7 @@ int netlink_list_sets(struct netlink_ctx *ctx, const struct handle *h, if (errno == EINTR) return -1; - return netlink_io_error(ctx, loc, - "Could not receive sets from kernel: %s", - strerror(errno)); + return 0; } err = nftnl_set_list_foreach(set_cache, list_set_cb, ctx); @@ -1789,9 +1781,7 @@ int netlink_list_objs(struct netlink_ctx *ctx, const struct handle *h, if (errno == EINTR) return -1; - return netlink_io_error(ctx, loc, - "Could not receive stateful objects from kernel: %s", - strerror(errno)); + return 0; } err = nftnl_obj_list_foreach(obj_cache, list_obj_cb, ctx); |