]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: check for errors from cache_init_objects() for stateful objects
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 23 Jan 2017 13:35:42 +0000 (14:35 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 23 Jan 2017 13:39:24 +0000 (14:39 +0100)
Catch -1 case, so we have a chance to handle EINTR.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index f2ffd4b27e8abc2b7782e82b5fb2f756663abd60..b5181a90f795d5ce3aa23a8131187c237ce661f7 100644 (file)
@@ -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);
                }