|
@@ -13,6 +13,7 @@
|
|
|
struct tcf_idrinfo {
|
|
|
spinlock_t lock;
|
|
|
struct idr action_idr;
|
|
|
+ struct net *net;
|
|
|
};
|
|
|
|
|
|
struct tc_action_ops;
|
|
@@ -104,7 +105,7 @@ struct tc_action_net {
|
|
|
|
|
|
static inline
|
|
|
int tc_action_net_init(struct tc_action_net *tn,
|
|
|
- const struct tc_action_ops *ops)
|
|
|
+ const struct tc_action_ops *ops, struct net *net)
|
|
|
{
|
|
|
int err = 0;
|
|
|
|
|
@@ -112,6 +113,7 @@ int tc_action_net_init(struct tc_action_net *tn,
|
|
|
if (!tn->idrinfo)
|
|
|
return -ENOMEM;
|
|
|
tn->ops = ops;
|
|
|
+ tn->idrinfo->net = net;
|
|
|
spin_lock_init(&tn->idrinfo->lock);
|
|
|
idr_init(&tn->idrinfo->action_idr);
|
|
|
return err;
|
|
@@ -122,7 +124,9 @@ void tcf_idrinfo_destroy(const struct tc_action_ops *ops,
|
|
|
|
|
|
static inline void tc_action_net_exit(struct tc_action_net *tn)
|
|
|
{
|
|
|
+ rtnl_lock();
|
|
|
tcf_idrinfo_destroy(tn->ops, tn->idrinfo);
|
|
|
+ rtnl_unlock();
|
|
|
kfree(tn->idrinfo);
|
|
|
}
|
|
|
|