Re: [PATCH nft] netlink: use nftnl_flowtable_get/set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 12, 2018 at 01:00:17PM +0100, Florian Westphal wrote:
> the '_array' variant is just a wrapper for get/set api; this
> allows the array variant to be removed from libnftnl.

LGTM, thanks Florian!

> Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
> ---
>  src/netlink.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/netlink.c b/src/netlink.c
> index a74dc2551e88..bfa30502a2b2 100644
> --- a/src/netlink.c
> +++ b/src/netlink.c
> @@ -1588,7 +1588,7 @@ int netlink_add_flowtable(struct netlink_ctx *ctx, const struct handle *h,
>  		dev_array[i++] = expr->identifier;
>  
>  	dev_array[i] = NULL;
> -	nftnl_flowtable_set_array(flo, NFTNL_FLOWTABLE_DEVICES, dev_array);
> +	nftnl_flowtable_set(flo, NFTNL_FLOWTABLE_DEVICES, dev_array);
>  
>  	netlink_dump_flowtable(flo, ctx);
>  
> @@ -1678,7 +1678,7 @@ netlink_delinearize_flowtable(struct netlink_ctx *ctx,
>  			      struct nftnl_flowtable *nlo)
>  {
>  	struct flowtable *flowtable;
> -	const char **dev_array;
> +	const char * const *dev_array;
>  	int len = 0, i;
>  
>  	flowtable = flowtable_alloc(&netlink_location);
> @@ -1688,8 +1688,8 @@ netlink_delinearize_flowtable(struct netlink_ctx *ctx,
>  		xstrdup(nftnl_flowtable_get_str(nlo, NFTNL_FLOWTABLE_TABLE));
>  	flowtable->handle.flowtable =
>  		xstrdup(nftnl_flowtable_get_str(nlo, NFTNL_FLOWTABLE_NAME));
> -	dev_array = nftnl_flowtable_get_array(nlo, NFTNL_FLOWTABLE_DEVICES);
> -	while (dev_array[len] != '\0')
> +	dev_array = nftnl_flowtable_get(nlo, NFTNL_FLOWTABLE_DEVICES);
> +	while (dev_array[len])
>  		len++;
>  
>  	flowtable->dev_array = calloc(1, len * sizeof(char *));
> -- 
> 2.16.1
> 
> --
> 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
--
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



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux