|
@@ -59,12 +59,19 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp)
|
|
if (!*ext)
|
|
if (!*ext)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
|
|
+ INIT_RCU_HEAD(&(*ext)->rcu);
|
|
(*ext)->offset[id] = off;
|
|
(*ext)->offset[id] = off;
|
|
(*ext)->len = len;
|
|
(*ext)->len = len;
|
|
|
|
|
|
return (void *)(*ext) + off;
|
|
return (void *)(*ext) + off;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void __nf_ct_ext_free_rcu(struct rcu_head *head)
|
|
|
|
+{
|
|
|
|
+ struct nf_ct_ext *ext = container_of(head, struct nf_ct_ext, rcu);
|
|
|
|
+ kfree(ext);
|
|
|
|
+}
|
|
|
|
+
|
|
void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
|
|
void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
|
|
{
|
|
{
|
|
struct nf_ct_ext *new;
|
|
struct nf_ct_ext *new;
|
|
@@ -106,7 +113,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
|
|
(void *)ct->ext + ct->ext->offset[i]);
|
|
(void *)ct->ext + ct->ext->offset[i]);
|
|
rcu_read_unlock();
|
|
rcu_read_unlock();
|
|
}
|
|
}
|
|
- kfree(ct->ext);
|
|
|
|
|
|
+ call_rcu(&ct->ext->rcu, __nf_ct_ext_free_rcu);
|
|
ct->ext = new;
|
|
ct->ext = new;
|
|
}
|
|
}
|
|
|
|
|