File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -2009,14 +2009,17 @@ EXPORT_SYMBOL_GPL(nft_unregister_expr);
20092009static const struct nft_expr_type * __nft_expr_type_get (u8 family ,
20102010 struct nlattr * nla )
20112011{
2012- const struct nft_expr_type * type ;
2012+ const struct nft_expr_type * type , * candidate = NULL ;
20132013
20142014 list_for_each_entry (type , & nf_tables_expressions , list ) {
2015- if (!nla_strcmp (nla , type -> name ) &&
2016- (!type -> family || type -> family == family ))
2017- return type ;
2015+ if (!nla_strcmp (nla , type -> name )) {
2016+ if (!type -> family && !candidate )
2017+ candidate = type ;
2018+ else if (type -> family == family )
2019+ candidate = type ;
2020+ }
20182021 }
2019- return NULL ;
2022+ return candidate ;
20202023}
20212024
20222025#ifdef CONFIG_MODULES
You can’t perform that action at this time.
0 commit comments