netfilter: x_tables: introduce and use xt_copy_counters_from_user

commit d7591f0c41 upstream.

The three variants use same copy&pasted code, condense this into a
helper and use that.

Make sure info.name is 0-terminated.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Florian Westphal 2016-04-01 15:37:59 +02:00 • committed by Ben Hutchings
commit 019475d646
5 changed files with 92 additions and 130 deletions