Skip to content

Commit 4abff07

Browse files
Jan Engelhardtkaber
authored andcommitted
[NETFILTER]: remove arpt_table indirection macro
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
1 parent 72b7294 commit 4abff07

3 files changed

Lines changed: 19 additions & 21 deletions

File tree

include/linux/netfilter_arp/arp_tables.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
2525
#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
2626
#define arpt_target xt_target
27-
#define arpt_table xt_table
2827

2928
#define ARPT_DEV_ADDR_LEN_MAX 16
3029

@@ -271,15 +270,15 @@ struct arpt_error
271270
xt_register_target(tgt); })
272271
#define arpt_unregister_target(tgt) xt_unregister_target(tgt)
273272

274-
extern struct arpt_table *arpt_register_table(struct net *net,
275-
struct arpt_table *table,
276-
const struct arpt_replace *repl);
277-
extern void arpt_unregister_table(struct arpt_table *table);
273+
extern struct xt_table *arpt_register_table(struct net *net,
274+
struct xt_table *table,
275+
const struct arpt_replace *repl);
276+
extern void arpt_unregister_table(struct xt_table *table);
278277
extern unsigned int arpt_do_table(struct sk_buff *skb,
279278
unsigned int hook,
280279
const struct net_device *in,
281280
const struct net_device *out,
282-
struct arpt_table *table);
281+
struct xt_table *table);
283282

284283
#define ARPT_ALIGN(s) XT_ALIGN(s)
285284

net/ipv4/netfilter/arp_tables.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ unsigned int arpt_do_table(struct sk_buff *skb,
222222
unsigned int hook,
223223
const struct net_device *in,
224224
const struct net_device *out,
225-
struct arpt_table *table)
225+
struct xt_table *table)
226226
{
227227
static const char nulldevname[IFNAMSIZ];
228228
unsigned int verdict = NF_DROP;
@@ -706,7 +706,7 @@ static void get_counters(const struct xt_table_info *t,
706706
}
707707
}
708708

709-
static inline struct xt_counters *alloc_counters(struct arpt_table *table)
709+
static inline struct xt_counters *alloc_counters(struct xt_table *table)
710710
{
711711
unsigned int countersize;
712712
struct xt_counters *counters;
@@ -731,13 +731,13 @@ static inline struct xt_counters *alloc_counters(struct arpt_table *table)
731731
}
732732

733733
static int copy_entries_to_user(unsigned int total_size,
734-
struct arpt_table *table,
734+
struct xt_table *table,
735735
void __user *userptr)
736736
{
737737
unsigned int off, num;
738738
struct arpt_entry *e;
739739
struct xt_counters *counters;
740-
const struct xt_table_info *private = table->private;
740+
struct xt_table_info *private = table->private;
741741
int ret = 0;
742742
void *loc_cpu_entry;
743743

@@ -851,7 +851,7 @@ static int compat_table_info(const struct xt_table_info *info,
851851
static int get_info(struct net *net, void __user *user, int *len, int compat)
852852
{
853853
char name[ARPT_TABLE_MAXNAMELEN];
854-
struct arpt_table *t;
854+
struct xt_table *t;
855855
int ret;
856856

857857
if (*len != sizeof(struct arpt_getinfo)) {
@@ -911,7 +911,7 @@ static int get_entries(struct net *net, struct arpt_get_entries __user *uptr,
911911
{
912912
int ret;
913913
struct arpt_get_entries get;
914-
struct arpt_table *t;
914+
struct xt_table *t;
915915

916916
if (*len < sizeof(get)) {
917917
duprintf("get_entries: %u < %Zu\n", *len, sizeof(get));
@@ -954,7 +954,7 @@ static int __do_replace(struct net *net, const char *name,
954954
void __user *counters_ptr)
955955
{
956956
int ret;
957-
struct arpt_table *t;
957+
struct xt_table *t;
958958
struct xt_table_info *oldinfo;
959959
struct xt_counters *counters;
960960
void *loc_cpu_old_entry;
@@ -1091,7 +1091,7 @@ static int do_add_counters(struct net *net, void __user *user, unsigned int len,
10911091
const char *name;
10921092
int size;
10931093
void *ptmp;
1094-
struct arpt_table *t;
1094+
struct xt_table *t;
10951095
const struct xt_table_info *private;
10961096
int ret = 0;
10971097
void *loc_cpu_entry;
@@ -1555,7 +1555,7 @@ static int compat_copy_entry_to_user(struct arpt_entry *e, void __user **dstptr,
15551555
}
15561556

15571557
static int compat_copy_entries_to_user(unsigned int total_size,
1558-
struct arpt_table *table,
1558+
struct xt_table *table,
15591559
void __user *userptr)
15601560
{
15611561
struct xt_counters *counters;
@@ -1593,7 +1593,7 @@ static int compat_get_entries(struct net *net,
15931593
{
15941594
int ret;
15951595
struct compat_arpt_get_entries get;
1596-
struct arpt_table *t;
1596+
struct xt_table *t;
15971597

15981598
if (*len < sizeof(get)) {
15991599
duprintf("compat_get_entries: %u < %zu\n", *len, sizeof(get));
@@ -1723,9 +1723,8 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len
17231723
return ret;
17241724
}
17251725

1726-
struct arpt_table *arpt_register_table(struct net *net,
1727-
struct arpt_table *table,
1728-
const struct arpt_replace *repl)
1726+
struct xt_table *arpt_register_table(struct net *net, struct xt_table *table,
1727+
const struct arpt_replace *repl)
17291728
{
17301729
int ret;
17311730
struct xt_table_info *newinfo;
@@ -1767,7 +1766,7 @@ struct arpt_table *arpt_register_table(struct net *net,
17671766
return ERR_PTR(ret);
17681767
}
17691768

1770-
void arpt_unregister_table(struct arpt_table *table)
1769+
void arpt_unregister_table(struct xt_table *table)
17711770
{
17721771
struct xt_table_info *private;
17731772
void *loc_cpu_entry;

net/ipv4/netfilter/arptable_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static struct
4545
.term = ARPT_ERROR_INIT,
4646
};
4747

48-
static struct arpt_table packet_filter = {
48+
static struct xt_table packet_filter = {
4949
.name = "filter",
5050
.valid_hooks = FILTER_VALID_HOOKS,
5151
.lock = __RW_LOCK_UNLOCKED(packet_filter.lock),

0 commit comments

Comments
 (0)