|
@@ -1290,6 +1290,21 @@ static int xt_jumpstack_alloc(struct xt_table_info *i)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+struct xt_counters *xt_counters_alloc(unsigned int counters)
|
|
|
+{
|
|
|
+ struct xt_counters *mem;
|
|
|
+
|
|
|
+ if (counters == 0 || counters > INT_MAX / sizeof(*mem))
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ counters *= sizeof(*mem);
|
|
|
+ if (counters > XT_MAX_TABLE_SIZE)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return vzalloc(counters);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(xt_counters_alloc);
|
|
|
+
|
|
|
struct xt_table_info *
|
|
|
xt_replace_table(struct xt_table *table,
|
|
|
unsigned int num_counters,
|