diff mbox series

[nft,2/2] netlink: no EINTR handling from netlink_get_setelem()

Message ID 20180424100039.13231-2-pablo@netfilter.org
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft,1/2] src: centralize netlink error reporting | expand

Commit Message

Pablo Neira Ayuso April 24, 2018, 10 a.m. UTC
This cannot happen, this call does not set the NLM_F_DUMP flag.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/netlink.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/src/netlink.c b/src/netlink.c
index 525100b62f15..75c371dcf2a8 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -1332,7 +1332,6 @@  int netlink_get_setelem(struct netlink_ctx *ctx, const struct handle *h,
 			struct set *set, struct expr *init)
 {
 	struct nftnl_set *nls, *nls_out = NULL;
-	int err = 0;
 
 	nls = alloc_nftnl_set(h);
 	alloc_setelem_cache(init, nls);
@@ -1340,14 +1339,8 @@  int netlink_get_setelem(struct netlink_ctx *ctx, const struct handle *h,
 	netlink_dump_set(nls, ctx);
 
 	nls_out = mnl_nft_setelem_get_one(ctx, nls);
-	if (!nls_out) {
-		nftnl_set_free(nls);
-		if (errno == EINTR)
-			return -1;
-
-		err = -1;
-		goto out;
-	}
+	if (!nls_out)
+		return -1;
 
 	ctx->set = set;
 	set->init = set_expr_alloc(loc, set);
@@ -1362,8 +1355,8 @@  int netlink_get_setelem(struct netlink_ctx *ctx, const struct handle *h,
 
 	if (set->flags & NFT_SET_INTERVAL)
 		get_set_decompose(table, set);
-out:
-	return err;
+
+	return 0;
 }
 
 void netlink_dump_obj(struct nftnl_obj *nln, struct netlink_ctx *ctx)