From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH libnftnl 5/9] expr: data_reg: get rid of leftover perror() calls
Date: Tue, 14 Jun 2016 15:18:41 +0200 [thread overview]
Message-ID: <1465910325-13286-5-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1465910325-13286-1-git-send-email-pablo@netfilter.org>
Let the client of this library decide when to display error messages.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/expr/data_reg.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/expr/data_reg.c b/src/expr/data_reg.c
index 6aa47bc..688823b 100644
--- a/src/expr/data_reg.c
+++ b/src/expr/data_reg.c
@@ -428,10 +428,8 @@ nftnl_parse_verdict(union nftnl_data_reg *data, const struct nlattr *attr, int *
{
struct nlattr *tb[NFTA_VERDICT_MAX+1];
- if (mnl_attr_parse_nested(attr, nftnl_verdict_parse_cb, tb) < 0) {
- perror("mnl_attr_parse_nested");
+ if (mnl_attr_parse_nested(attr, nftnl_verdict_parse_cb, tb) < 0)
return -1;
- }
if (!tb[NFTA_VERDICT_CODE])
return -1;
@@ -491,10 +489,9 @@ int nftnl_parse_data(union nftnl_data_reg *data, struct nlattr *attr, int *type)
struct nlattr *tb[NFTA_DATA_MAX+1] = {};
int ret = 0;
- if (mnl_attr_parse_nested(attr, nftnl_data_parse_cb, tb) < 0) {
- perror("mnl_attr_parse_nested");
+ if (mnl_attr_parse_nested(attr, nftnl_data_parse_cb, tb) < 0)
return -1;
- }
+
if (tb[NFTA_DATA_VALUE]) {
if (type)
*type = DATA_VALUE;
--
2.1.4
next prev parent reply other threads:[~2016-06-14 13:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 13:18 [PATCH libnftnl 1/9] src: get rid of aliases Pablo Neira Ayuso
2016-06-14 13:18 ` [PATCH libnftnl 2/9] src: assert when setting unknown attributes Pablo Neira Ayuso
2016-06-14 13:18 ` [PATCH libnftnl 3/9] src: return value on setters that internally allocate memory Pablo Neira Ayuso
2016-06-14 13:18 ` [PATCH libnftnl 4/9] src: check for strdup() errors from setters and parsers Pablo Neira Ayuso
2016-06-14 13:18 ` Pablo Neira Ayuso [this message]
2016-06-14 13:18 ` [PATCH libnftnl 6/9] src: simplify unsetters Pablo Neira Ayuso
2016-06-14 13:18 ` [PATCH libnftnl 7/9] src: check for flags before releasing attributes Pablo Neira Ayuso
2016-06-14 13:18 ` [PATCH libnftnl 8/9] tests: shuffle values that are injected Pablo Neira Ayuso
2016-06-14 13:18 ` [PATCH libnftnl 9/9] chain: dynamically allocate name 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=1465910325-13286-5-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).