From 5b8ae79fae3bc8be9663bd752c7ec466a95ac180 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 10 Jun 2016 14:49:01 +0200 Subject: expr: data_reg: get rid of leftover perror() calls Let the client of this library decide when to display error messages. Signed-off-by: Pablo Neira Ayuso --- src/expr/data_reg.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/expr') 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; -- cgit v1.2.3