From 305b4707d134362c9229241b922c3b2286d3c150 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 22 Mar 2015 20:59:42 +0100 Subject: src: restore static array with expression operations 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. This patch reverts 4dd0772 ("expr: use __attribute__((constructor)) to register expression"). Reported-by: Laurent Bercot Signed-off-by: Pablo Neira Ayuso --- include/expr_ops.h | 3 --- include/utils.h | 1 - 2 files changed, 4 deletions(-) (limited to 'include') diff --git a/include/expr_ops.h b/include/expr_ops.h index ea5defd..08cf57f 100644 --- a/include/expr_ops.h +++ b/include/expr_ops.h @@ -9,8 +9,6 @@ struct nlmsghdr; struct nft_rule_expr; struct expr_ops { - struct list_head head; - const char *name; uint32_t alloc_len; int max_attr; @@ -26,7 +24,6 @@ struct expr_ops { struct nft_parse_err *err); }; -void nft_expr_ops_register(struct expr_ops *ops); struct expr_ops *nft_expr_ops_lookup(const char *name); #define nft_expr_data(ops) (void *)ops->data diff --git a/include/utils.h b/include/utils.h index 1801108..380b020 100644 --- a/include/utils.h +++ b/include/utils.h @@ -15,7 +15,6 @@ # define EXPORT_SYMBOL #endif -#define __init __attribute__((constructor)) #define __noreturn __attribute__((__noreturn__)) #define xfree(ptr) free((void *)ptr); -- cgit v1.2.3