netlink_dump_set(nls);
set = netlink_delinearize_set(ctx, nls);
+ if (set == NULL)
+ return -1;
list_add_tail(&set->list, &ctx->list);
return 0;
}
const struct location *loc)
{
struct nft_set_list *set_cache;
+ int err;
set_cache = mnl_nft_set_dump(nf_sock, h->family, h->table);
if (set_cache == NULL)
"Could not receive sets from kernel: %s",
strerror(errno));
- nft_set_list_foreach(set_cache, list_set_cb, ctx);
+ err = nft_set_list_foreach(set_cache, list_set_cb, ctx);
nft_set_list_free(set_cache);
- return 0;
+ return err;
}
int netlink_get_set(struct netlink_ctx *ctx, const struct handle *h,
strerror(errno));
set = netlink_delinearize_set(ctx, nls);
+ if (set == NULL)
+ return -1;
list_add_tail(&set->list, &ctx->list);
nft_set_free(nls);
if (type == NFT_MSG_NEWSET) {
printf("add ");
set = netlink_delinearize_set(monh->ctx, nls);
+ if (set == NULL)
+ return MNL_CB_ERROR;
set_print_plain(set);
set_free(set);
} else {
set_tmpctx.msgs = &msgs;
s = netlink_delinearize_set(&set_tmpctx, nls);
+ if (s == NULL)
+ return;
s->init = set_expr_alloc(monh->loc);
t = table_lookup(&s->handle);