@@ -3853,7 +3853,7 @@ static int nf_tables_fill_setelem(struct sk_buff *skb,
3853
3853
3854
3854
if (nft_set_ext_exists (ext , NFT_SET_EXT_OBJREF ) &&
3855
3855
nla_put_string (skb , NFTA_SET_ELEM_OBJREF ,
3856
- (* nft_set_ext_obj (ext ))-> name ) < 0 )
3856
+ (* nft_set_ext_obj (ext ))-> key . name ) < 0 )
3857
3857
goto nla_put_failure ;
3858
3858
3859
3859
if (nft_set_ext_exists (ext , NFT_SET_EXT_FLAGS ) &&
@@ -4826,7 +4826,7 @@ struct nft_object *nft_obj_lookup(const struct nft_table *table,
4826
4826
struct nft_object * obj ;
4827
4827
4828
4828
list_for_each_entry_rcu (obj , & table -> objects , list ) {
4829
- if (!nla_strcmp (nla , obj -> name ) &&
4829
+ if (!nla_strcmp (nla , obj -> key . name ) &&
4830
4830
objtype == obj -> ops -> type -> type &&
4831
4831
nft_active_genmask (obj , genmask ))
4832
4832
return obj ;
@@ -5014,11 +5014,11 @@ static int nf_tables_newobj(struct net *net, struct sock *nlsk,
5014
5014
err = PTR_ERR (obj );
5015
5015
goto err1 ;
5016
5016
}
5017
- obj -> table = table ;
5017
+ obj -> key . table = table ;
5018
5018
obj -> handle = nf_tables_alloc_handle (table );
5019
5019
5020
- obj -> name = nla_strdup (nla [NFTA_OBJ_NAME ], GFP_KERNEL );
5021
- if (!obj -> name ) {
5020
+ obj -> key . name = nla_strdup (nla [NFTA_OBJ_NAME ], GFP_KERNEL );
5021
+ if (!obj -> key . name ) {
5022
5022
err = - ENOMEM ;
5023
5023
goto err2 ;
5024
5024
}
@@ -5031,7 +5031,7 @@ static int nf_tables_newobj(struct net *net, struct sock *nlsk,
5031
5031
table -> use ++ ;
5032
5032
return 0 ;
5033
5033
err3 :
5034
- kfree (obj -> name );
5034
+ kfree (obj -> key . name );
5035
5035
err2 :
5036
5036
if (obj -> ops -> destroy )
5037
5037
obj -> ops -> destroy (& ctx , obj );
@@ -5060,7 +5060,7 @@ static int nf_tables_fill_obj_info(struct sk_buff *skb, struct net *net,
5060
5060
nfmsg -> res_id = htons (net -> nft .base_seq & 0xffff );
5061
5061
5062
5062
if (nla_put_string (skb , NFTA_OBJ_TABLE , table -> name ) ||
5063
- nla_put_string (skb , NFTA_OBJ_NAME , obj -> name ) ||
5063
+ nla_put_string (skb , NFTA_OBJ_NAME , obj -> key . name ) ||
5064
5064
nla_put_be32 (skb , NFTA_OBJ_TYPE , htonl (obj -> ops -> type -> type )) ||
5065
5065
nla_put_be32 (skb , NFTA_OBJ_USE , htonl (obj -> use )) ||
5066
5066
nft_object_dump (skb , NFTA_OBJ_DATA , obj , reset ) ||
@@ -5246,7 +5246,7 @@ static void nft_obj_destroy(const struct nft_ctx *ctx, struct nft_object *obj)
5246
5246
obj -> ops -> destroy (ctx , obj );
5247
5247
5248
5248
module_put (obj -> ops -> type -> owner );
5249
- kfree (obj -> name );
5249
+ kfree (obj -> key . name );
5250
5250
kfree (obj );
5251
5251
}
5252
5252
@@ -5297,7 +5297,7 @@ static int nf_tables_delobj(struct net *net, struct sock *nlsk,
5297
5297
return nft_delobj (& ctx , obj );
5298
5298
}
5299
5299
5300
- void nft_obj_notify (struct net * net , struct nft_table * table ,
5300
+ void nft_obj_notify (struct net * net , const struct nft_table * table ,
5301
5301
struct nft_object * obj , u32 portid , u32 seq , int event ,
5302
5302
int family , int report , gfp_t gfp )
5303
5303
{
@@ -6404,6 +6404,11 @@ static void nf_tables_commit_chain(struct net *net, struct nft_chain *chain)
6404
6404
nf_tables_commit_chain_free_rules_old (g0 );
6405
6405
}
6406
6406
6407
+ static void nft_obj_del (struct nft_object * obj )
6408
+ {
6409
+ list_del_rcu (& obj -> list );
6410
+ }
6411
+
6407
6412
static void nft_chain_del (struct nft_chain * chain )
6408
6413
{
6409
6414
struct nft_table * table = chain -> table ;
@@ -6580,7 +6585,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
6580
6585
nft_trans_destroy (trans );
6581
6586
break ;
6582
6587
case NFT_MSG_DELOBJ :
6583
- list_del_rcu ( & nft_trans_obj (trans )-> list );
6588
+ nft_obj_del ( nft_trans_obj (trans ));
6584
6589
nf_tables_obj_notify (& trans -> ctx , nft_trans_obj (trans ),
6585
6590
NFT_MSG_DELOBJ );
6586
6591
break ;
@@ -7330,7 +7335,7 @@ static void __nft_release_tables(struct net *net)
7330
7335
nft_set_destroy (set );
7331
7336
}
7332
7337
list_for_each_entry_safe (obj , ne , & table -> objects , list ) {
7333
- list_del ( & obj -> list );
7338
+ nft_obj_del ( obj );
7334
7339
table -> use -- ;
7335
7340
nft_obj_destroy (& ctx , obj );
7336
7341
}
0 commit comments