All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Varsha Rao <rvarsha016@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft 2/3] include: Remove __init macro definition.
Date: Fri, 30 Jun 2017 12:56:33 +0200	[thread overview]
Message-ID: <20170630105633.GB1876@salvia> (raw)
In-Reply-To: <252529ca943916a9b9473b7a443460a6559dc8d2.1498814530.git.rvarsha016@gmail.com>

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@gmail.com>
> ---
>  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.

  reply	other threads:[~2017-06-30 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30  9:24 [PATCH nft 0/3] include: Remove datatype_register(), __init and __exit macros Varsha Rao
2017-06-30  9:26 ` [PATCH nft 1/3] include: Remove datatype_register() Varsha Rao
2017-06-30 10:45   ` Pablo Neira Ayuso
2017-06-30  9:27 ` [PATCH nft 2/3] include: Remove __init macro definition Varsha Rao
2017-06-30 10:56   ` Pablo Neira Ayuso [this message]
2017-06-30  9:28 ` [PATCH nft 3/3] include: Remove __exit " Varsha Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170630105633.GB1876@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=rvarsha016@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.