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);
2009
2009
static const struct nft_expr_type * __nft_expr_type_get (u8 family ,
2010
2010
struct nlattr * nla )
2011
2011
{
2012
- const struct nft_expr_type * type ;
2012
+ const struct nft_expr_type * type , * candidate = NULL ;
2013
2013
2014
2014
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
+ }
2018
2021
}
2019
- return NULL ;
2022
+ return candidate ;
2020
2023
}
2021
2024
2022
2025
#ifdef CONFIG_MODULES
You can’t perform that action at this time.
0 commit comments