Re: [PATCH libnftnl] src: restore static array with expression operations

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

 



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@xxxxxxxxxxx>
> > Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
--
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