The three variants use same copy&pasted code, condense this into a helper and use that. Make sure info.name is 0-terminated.
Showing the changes to include/linux/netfilter (1 of 5 files). Show all
Unified · Split
| @@ -251,6 +251,9 @@ int xt_check_match(struct xt_mtchk_param *, unsigned int size, u_int8_t proto, · 250 unmodified lines | ||
| 251 | 251 | int xt_check_target(struct xt_tgchk_param *, unsigned int size, u_int8_t proto, |
| 252 | 252 | bool inv_proto); |
| 253 | 253 | |
| 254 | +void *xt_copy_counters_from_user(const void __user *user, unsigned int len, | |
| 255 | + struct xt_counters_info *info, bool compat); | |
| 256 | + | |
| 254 | 257 | struct xt_table *xt_register_table(struct net *net, |
| 255 | 258 | const struct xt_table *table, |
| 256 | 259 | struct xt_table_info *bootstrap, |