netfilter: x_tables: pass xt_counters struct to counter allocator

Keeps some noise away from a followup patch.

Signed-off-by: Florian Westphal <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
This commit is contained in:
Florian Westphal 2016-11-22 14:44:18 +01:00 • committed by Pablo Neira Ayuso
commit f28e15bace
5 changed files with 34 additions and 38 deletions

View file

@ -415,13 +415,10 @@ find_check_entry(struct arpt_entry *e, const char *name, unsigned int size)
{
struct xt_entry_target *t;
struct xt_target *target;
unsigned long pcnt;
int ret;
pcnt = xt_percpu_counter_alloc();
if (IS_ERR_VALUE(pcnt))
if (!xt_percpu_counter_alloc(&e->counters))
return -ENOMEM;
e->counters.pcnt = pcnt;
t = arpt_get_target(e);
target = xt_request_find_target(NFPROTO_ARP, t->u.user.name,

View file

@ -539,12 +539,9 @@ find_check_entry(struct ipt_entry *e, struct net *net, const char *name,
unsigned int j;
struct xt_mtchk_param mtpar;
struct xt_entry_match *ematch;
unsigned long pcnt;
pcnt = xt_percpu_counter_alloc();
if (IS_ERR_VALUE(pcnt))
if (!xt_percpu_counter_alloc(&e->counters))
return -ENOMEM;
e->counters.pcnt = pcnt;
j = 0;
mtpar.net = net;