Re: [PATCH nft 2/3] include: Remove __init macro definition.

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

 



On Fri, Jun 30, 2017 at 02:57:12PM +0530, Varsha Rao wrote:
> Add nft_init function, which calls _init functions in main.c file.
> Remove __init macro definition as libnftables library will be created
> soon. Rename realm_table_init() function to avoid ambiguity as
> realm_table_rt_init() and realm_table_meta_init() in rt.c and meta.c
> files.
> 
> Signed-off-by: Varsha Rao <rvarsha016@xxxxxxxxx>
> ---
>  include/nftables.h |  9 +++++++++
>  include/utils.h    |  1 -
>  src/ct.c           |  2 +-
>  src/datatype.c     |  2 +-
>  src/gmputil.c      |  2 +-
>  src/main.c         | 15 +++++++++++++++
>  src/meta.c         |  4 ++--
>  src/netlink.c      |  2 +-
>  src/rt.c           |  2 +-
>  src/xt.c           |  2 +-
>  10 files changed, 32 insertions(+), 9 deletions(-)
> 
> diff --git a/include/nftables.h b/include/nftables.h
> index 26fd344..b188b9e 100644
> --- a/include/nftables.h
> +++ b/include/nftables.h
> @@ -117,5 +117,14 @@ struct parser_state;
>  
>  int nft_run(struct nft_ctx *nft, void *scanner, struct parser_state *state,
>  	    struct list_head *msgs);
> +void ct_label_table_init(void);
> +void mark_table_init(void);
> +void gmp_init(void);
> +void realm_table_rt_init(void);
> +void devgroup_table_init(void);
> +void netlink_open_sock(void);

OK, so before I apply this, I would like that we remove
netlink_open_sock() from nft_init().

Could you make a patch that does the following (in steps):

1) Add a new struct mnl_socket * field to struct nft_ctx, you can name
   this new field as 'nf_sock'.
2) Call netlink_open_sock() from nft_netlink(), at the very beginning,
   so you set ctx->nf_sock.
3) Use ctx->nf_sock everywhere in src/netlink.c and src/mnl.c,
   so this is not global anymore.

All this in one single patch. As a result, we don't need to call
netlink_open_sock() from nft_init() anymore.
--
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