On Thu, Mar 19, 2015 at 09:24:09PM +0100, Laurent Bercot wrote: > > Hello, > > (Platform: Intel Atom (x86_64), Linux 3.19.1, musl 1.1.7, > latest nftables/libnftnl/libmnl from git. All iptables modules > out of the kernel, all necessary nftables modules in.) > > I can flush tables, create tables and create chains with nft > without trouble; however, every time I try and add a rule to > a chain, no matter what chain, no matter in what table, I get > the following error: > > netlink.c:182: Memory allocation failure I think this error is bogus. Please, apply this patch to libnftnl and let us know. For some reason __init is being ignored, are you using gcc?
diff --git a/src/expr.c b/src/expr.c index 79782fa..db84d0b 100644 --- a/src/expr.c +++ b/src/expr.c @@ -29,8 +29,11 @@ struct nft_rule_expr *nft_rule_expr_alloc(const char *name) struct expr_ops *ops; ops = nft_expr_ops_lookup(name); - if (ops == NULL) + if (ops == NULL) { + fprintf(stderr, "libnftnl: Expression '%s' not supported\n", + name); return NULL; + } expr = calloc(1, sizeof(struct nft_rule_expr) + ops->alloc_len); if (expr == NULL)