Skip to content

Commit

Permalink
netfilter: nf_tables: Stack expression type depending on their family
Browse files Browse the repository at this point in the history
To ensure family tight expression gets selected in priority to family
agnostic ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Tomasz Bursztyka authored and Pablo Neira Ayuso committed Apr 23, 2014
1 parent 60eb189 commit 758dbce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,10 @@ static void nft_ctx_init(struct nft_ctx *ctx,
int nft_register_expr(struct nft_expr_type *type)
{
nfnl_lock(NFNL_SUBSYS_NFTABLES);
list_add_tail(&type->list, &nf_tables_expressions);
if (type->family == NFPROTO_UNSPEC)
list_add_tail(&type->list, &nf_tables_expressions);
else
list_add(&type->list, &nf_tables_expressions);
nfnl_unlock(NFNL_SUBSYS_NFTABLES);
return 0;
}
Expand Down

0 comments on commit 758dbce

Please sign in to comment.