From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft] rule: check for EINTR error from cache_init_objects() for stateful objects
Date: Tue, 24 Jan 2017 19:36:26 +0100 [thread overview]
Message-ID: <1485282987-9118-1-git-send-email-pablo@netfilter.org> (raw)
Catch -1 case, so we have a chance to handle EINTR.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/rule.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/rule.c b/src/rule.c
index f2ffd4b27e8a..b5181a90f795 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);
}
--
2.1.4
next reply other threads:[~2017-01-24 18:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 18:36 Pablo Neira Ayuso [this message]
2017-01-24 18:36 ` [PATCH nft] tests: shell: validate set size Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2017-01-23 13:36 [PATCH nft] rule: check for EINTR error from cache_init_objects() for stateful objects Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485282987-9118-1-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).