Lets refactorize set_elem handling. Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx> --- src/netlink.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/netlink.c b/src/netlink.c index f0ea6ca..84f2b7e 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -953,11 +953,10 @@ int netlink_delete_setelems(struct netlink_ctx *ctx, const struct handle *h, return err; } -static int list_setelem_cb(struct nft_set_elem *nlse, void *arg) +static int netlink_delinearize_setelem(struct nft_set_elem *nlse, + struct set *set) { struct nft_data_delinearize nld; - struct netlink_ctx *ctx = arg; - struct set *set = ctx->set; struct expr *expr, *data; uint32_t flags = 0; @@ -1001,6 +1000,12 @@ out: return 0; } +static int list_setelem_cb(struct nft_set_elem *nlse, void *arg) +{ + struct netlink_ctx *ctx = arg; + return netlink_delinearize_setelem(nlse, ctx->set); +} + extern void interval_map_decompose(struct expr *set); int netlink_get_setelems(struct netlink_ctx *ctx, const struct handle *h, -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html