summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-01-23 14:35:42 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2017-01-23 14:39:24 +0100
commit4189bae732efbf6234e8627e442d0f17a2a4e2b7 (patch)
treec36aaa3fc82cdffa51d02ccf67c7f7ad3c5fe50d
parent04ccf3b2417ea17e1ec705cd6e442816e4eb4002 (diff)
rule: check for errors from cache_init_objects() for stateful objects
Catch -1 case, so we have a chance to handle EINTR. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/rule.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rule.c b/src/rule.c
index f2ffd4b2..b5181a90 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -96,10 +96,9 @@ static int cache_init_objects(struct netlink_ctx *ctx, enum cmd_ops cmd)
list_splice_tail_init(&ctx->list, &table->chains);
if (cmd != CMD_RESET) {
- /* Don't check for errors on listings, this would break
- * nft with old kernels with no stateful object support.
- */
- netlink_list_objs(ctx, &table->handle, &internal_location);
+ ret = netlink_list_objs(ctx, &table->handle, &internal_location);
+ if (ret < 0)
+ return -1;
list_splice_tail_init(&ctx->list, &table->objs);
}