All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org, ska-devel@skarnet.org
Subject: Re: [PATCH libnftnl] src: restore static array with expression operations
Date: Mon, 23 Mar 2015 13:34:00 +0100	[thread overview]
Message-ID: <20150323123400.GA6511@salvia> (raw)
In-Reply-To: <20150323114411.GH603@acer.localdomain>

On Mon, Mar 23, 2015 at 11:44:11AM +0000, Patrick McHardy wrote:
> On 23.03, Pablo Neira Ayuso wrote:
> > We cannot use __attribute__((constructor)) to register the supported
> > expressions in runtime when the library is statically linked. This lead
> > us to some explicit libnftnl_init() function that needs to be called
> > from the main() function of the client program.
> 
> Just wondering, why not? They should still be invoked, right?

This seems to run when the shared library is loaded. When the build is
static, that never happens.

In iptables, we're resolving this with an init_extensions() function
that is called from main() so these are registered in run-time. I
would like to skip such explicit call from the client programs.

If you have any better solution, let me know. I actually liked that
the expression class, including its registration was self-contained
:-(.

> > This patch reverts 4dd0772 ("expr: use __attribute__((constructor)) to
> > register expression").
> > 
> > Reported-by: Laurent Bercot <ska-devel@skarnet.org>
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

  reply	other threads:[~2015-03-23 12:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 11:44 [PATCH libnftnl] src: restore static array with expression operations Pablo Neira Ayuso
2015-03-23 11:44 ` Patrick McHardy
2015-03-23 12:34   ` Pablo Neira Ayuso [this message]
2015-03-23 13:08     ` Patrick McHardy
2015-03-23 13:21       ` Laurent Bercot
2015-03-23 13:33         ` Patrick McHardy
2015-03-23 13:37           ` Laurent Bercot
2015-03-23 13:54             ` Patrick McHardy
2015-03-23 14:19               ` Laurent Bercot
2015-03-23 14:50                 ` Patrick McHardy
2015-03-23 14:58                   ` Laurent Bercot

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=20150323123400.GA6511@salvia \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=ska-devel@skarnet.org \
    /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.