History

netfilter: x_tables: introduce and use xt_copy_counters_from_user

The three variants use same copy&pasted code, condense this into a helper and use that. Make sure info.name is 0-terminated.

Florian Westphal committed 10 years ago

Commit d7591f01 parent aded9f35 files · +92 −130Browse files

Showing the changes to include/linux/netfilter (1 of 5 files). Show all

Unified · Split

include/linux/netfilter/x_tables.h+3−0
@@ -251,6 +251,9 @@ int xt_check_match(struct xt_mtchk_param *, unsigned int size, u_int8_t proto, · 250 unmodified lines
251251 int xt_check_target(struct xt_tgchk_param *, unsigned int size, u_int8_t proto,
252252 bool inv_proto);
253253
254+void *xt_copy_counters_from_user(const void __user *user, unsigned int len,
255+ struct xt_counters_info *info, bool compat);
256+
254257 struct xt_table *xt_register_table(struct net *net,
255258 const struct xt_table *table,
256259 struct xt_table_info *bootstrap,