11 #include <linux/kernel.h>
12 #include <linux/module.h>
15 #include <linux/slab.h>
29 if (!__nf_ct_ext_exist(ext, i))
48 size_t var_alloc_len,
gfp_t gfp)
50 unsigned int off,
len;
58 len = off + t->
len + var_alloc_len;
62 *ext = kzalloc(alloc_size, gfp);
66 (*ext)->offset[
id] = off;
69 return (
void *)(*ext) + off;
73 size_t var_alloc_len,
gfp_t gfp)
76 int i, newlen, newoff;
84 return nf_ct_ext_create(&ct->
ext,
id, var_alloc_len, gfp);
86 if (__nf_ct_ext_exist(old,
id))
94 newlen = newoff + t->
len + var_alloc_len;
103 if (!__nf_ct_ext_exist(old, i))
109 t->
move((
void *)
new + new->offset[i],
110 (
void *)old + old->
offset[i]);
117 new->offset[
id] = newoff;
119 memset((
void *)
new + newoff, 0, newlen - newoff);
120 return (
void *)
new + newoff;
138 for (i = min; i <=
max; i++) {
140 lockdep_is_held(&nf_ct_ext_type_mutex));
148 lockdep_is_held(&nf_ct_ext_type_mutex));
149 if (t2 ==
NULL || t2 == t1 ||
165 if (nf_ct_ext_types[type->
id]) {
175 update_alloc_size(type);
187 update_alloc_size(type);