Skip to content

Commit 043ef46

Browse files
Jan Engelhardtkaber
authored andcommitted
netfilter: move Ebtables to use Xtables
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
1 parent 2d06d4a commit 043ef46

22 files changed

Lines changed: 158 additions & 193 deletions

‎include/linux/netfilter_bridge/ebtables.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct ebt_entry_match
124124
{
125125
union {
126126
char name[EBT_FUNCTION_MAXNAMELEN];
127-
struct ebt_match *match;
127+
struct xt_match *match;
128128
} u;
129129
/* size of data */
130130
unsigned int match_size;
@@ -135,7 +135,7 @@ struct ebt_entry_watcher
135135
{
136136
union {
137137
char name[EBT_FUNCTION_MAXNAMELEN];
138-
struct ebt_watcher *watcher;
138+
struct xt_target *watcher;
139139
} u;
140140
/* size of data */
141141
unsigned int watcher_size;
@@ -146,7 +146,7 @@ struct ebt_entry_target
146146
{
147147
union {
148148
char name[EBT_FUNCTION_MAXNAMELEN];
149-
struct ebt_target *target;
149+
struct xt_target *target;
150150
} u;
151151
/* size of data */
152152
unsigned int target_size;

‎net/bridge/netfilter/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ menu "Bridge: Netfilter Configuration"
77

88
config BRIDGE_NF_EBTABLES
99
tristate "Ethernet Bridge tables (ebtables) support"
10+
select NETFILTER_XTABLES
1011
help
1112
ebtables is a general, extensible frame/packet identification
1213
framework. Say 'Y' or 'M' here if you want to do Ethernet

‎net/bridge/netfilter/ebt_802_3.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ ebt_802_3_mt_check(const char *table, const void *entry,
5151
return true;
5252
}
5353

54-
static struct ebt_match filter_802_3 __read_mostly = {
55-
.name = EBT_802_3_MATCH,
54+
static struct xt_match ebt_802_3_mt_reg __read_mostly = {
55+
.name = "802_3",
5656
.revision = 0,
5757
.family = NFPROTO_BRIDGE,
5858
.match = ebt_802_3_mt,
@@ -63,12 +63,12 @@ static struct ebt_match filter_802_3 __read_mostly = {
6363

6464
static int __init ebt_802_3_init(void)
6565
{
66-
return ebt_register_match(&filter_802_3);
66+
return xt_register_match(&ebt_802_3_mt_reg);
6767
}
6868

6969
static void __exit ebt_802_3_fini(void)
7070
{
71-
ebt_unregister_match(&filter_802_3);
71+
xt_unregister_match(&ebt_802_3_mt_reg);
7272
}
7373

7474
module_init(ebt_802_3_init);

‎net/bridge/netfilter/ebt_among.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* August, 2003
88
*
99
*/
10-
11-
#include <linux/netfilter_bridge/ebtables.h>
12-
#include <linux/netfilter_bridge/ebt_among.h>
1310
#include <linux/ip.h>
1411
#include <linux/if_arp.h>
1512
#include <linux/module.h>
13+
#include <linux/netfilter/x_tables.h>
14+
#include <linux/netfilter_bridge/ebtables.h>
15+
#include <linux/netfilter_bridge/ebt_among.h>
1616

1717
static bool ebt_mac_wormhash_contains(const struct ebt_mac_wormhash *wh,
1818
const char *mac, __be32 ip)
@@ -211,8 +211,8 @@ ebt_among_mt_check(const char *table, const void *entry,
211211
return true;
212212
}
213213

214-
static struct ebt_match filter_among __read_mostly = {
215-
.name = EBT_AMONG_MATCH,
214+
static struct xt_match ebt_among_mt_reg __read_mostly = {
215+
.name = "among",
216216
.revision = 0,
217217
.family = NFPROTO_BRIDGE,
218218
.match = ebt_among_mt,
@@ -223,12 +223,12 @@ static struct ebt_match filter_among __read_mostly = {
223223

224224
static int __init ebt_among_init(void)
225225
{
226-
return ebt_register_match(&filter_among);
226+
return xt_register_match(&ebt_among_mt_reg);
227227
}
228228

229229
static void __exit ebt_among_fini(void)
230230
{
231-
ebt_unregister_match(&filter_among);
231+
xt_unregister_match(&ebt_among_mt_reg);
232232
}
233233

234234
module_init(ebt_among_init);

‎net/bridge/netfilter/ebt_arp.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ ebt_arp_mt_check(const char *table, const void *entry,
119119
return true;
120120
}
121121

122-
static struct ebt_match filter_arp __read_mostly = {
123-
.name = EBT_ARP_MATCH,
122+
static struct xt_match ebt_arp_mt_reg __read_mostly = {
123+
.name = "arp",
124124
.revision = 0,
125125
.family = NFPROTO_BRIDGE,
126126
.match = ebt_arp_mt,
@@ -131,12 +131,12 @@ static struct ebt_match filter_arp __read_mostly = {
131131

132132
static int __init ebt_arp_init(void)
133133
{
134-
return ebt_register_match(&filter_arp);
134+
return xt_register_match(&ebt_arp_mt_reg);
135135
}
136136

137137
static void __exit ebt_arp_fini(void)
138138
{
139-
ebt_unregister_match(&filter_arp);
139+
xt_unregister_match(&ebt_arp_mt_reg);
140140
}
141141

142142
module_init(ebt_arp_init);

‎net/bridge/netfilter/ebt_arpreply.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ ebt_arpreply_tg_check(const char *tablename, const void *entry,
7878
return true;
7979
}
8080

81-
static struct ebt_target reply_target __read_mostly = {
82-
.name = EBT_ARPREPLY_TARGET,
81+
static struct xt_target ebt_arpreply_tg_reg __read_mostly = {
82+
.name = "arpreply",
8383
.revision = 0,
8484
.family = NFPROTO_BRIDGE,
8585
.target = ebt_arpreply_tg,
@@ -90,12 +90,12 @@ static struct ebt_target reply_target __read_mostly = {
9090

9191
static int __init ebt_arpreply_init(void)
9292
{
93-
return ebt_register_target(&reply_target);
93+
return xt_register_target(&ebt_arpreply_tg_reg);
9494
}
9595

9696
static void __exit ebt_arpreply_fini(void)
9797
{
98-
ebt_unregister_target(&reply_target);
98+
xt_unregister_target(&ebt_arpreply_tg_reg);
9999
}
100100

101101
module_init(ebt_arpreply_init);

‎net/bridge/netfilter/ebt_dnat.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ ebt_dnat_tg_check(const char *tablename, const void *entry,
4747
return true;
4848
}
4949

50-
static struct ebt_target dnat __read_mostly = {
51-
.name = EBT_DNAT_TARGET,
50+
static struct xt_target ebt_dnat_tg_reg __read_mostly = {
51+
.name = "dnat",
5252
.revision = 0,
5353
.family = NFPROTO_BRIDGE,
5454
.target = ebt_dnat_tg,
@@ -59,12 +59,12 @@ static struct ebt_target dnat __read_mostly = {
5959

6060
static int __init ebt_dnat_init(void)
6161
{
62-
return ebt_register_target(&dnat);
62+
return xt_register_target(&ebt_dnat_tg_reg);
6363
}
6464

6565
static void __exit ebt_dnat_fini(void)
6666
{
67-
ebt_unregister_target(&dnat);
67+
xt_unregister_target(&ebt_dnat_tg_reg);
6868
}
6969

7070
module_init(ebt_dnat_init);

‎net/bridge/netfilter/ebt_ip.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ ebt_ip_mt_check(const char *table, const void *entry,
109109
return true;
110110
}
111111

112-
static struct ebt_match filter_ip __read_mostly = {
113-
.name = EBT_IP_MATCH,
112+
static struct xt_match ebt_ip_mt_reg __read_mostly = {
113+
.name = "ip",
114114
.revision = 0,
115115
.family = NFPROTO_BRIDGE,
116116
.match = ebt_ip_mt,
@@ -121,12 +121,12 @@ static struct ebt_match filter_ip __read_mostly = {
121121

122122
static int __init ebt_ip_init(void)
123123
{
124-
return ebt_register_match(&filter_ip);
124+
return xt_register_match(&ebt_ip_mt_reg);
125125
}
126126

127127
static void __exit ebt_ip_fini(void)
128128
{
129-
ebt_unregister_match(&filter_ip);
129+
xt_unregister_match(&ebt_ip_mt_reg);
130130
}
131131

132132
module_init(ebt_ip_init);

‎net/bridge/netfilter/ebt_ip6.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ ebt_ip6_mt_check(const char *table, const void *entry,
121121
return true;
122122
}
123123

124-
static struct ebt_match filter_ip6 =
125-
{
126-
.name = EBT_IP6_MATCH,
124+
static struct xt_match ebt_ip6_mt_reg __read_mostly = {
125+
.name = "ip6",
127126
.revision = 0,
128127
.family = NFPROTO_BRIDGE,
129128
.match = ebt_ip6_mt,
@@ -134,12 +133,12 @@ static struct ebt_match filter_ip6 =
134133

135134
static int __init ebt_ip6_init(void)
136135
{
137-
return ebt_register_match(&filter_ip6);
136+
return xt_register_match(&ebt_ip6_mt_reg);
138137
}
139138

140139
static void __exit ebt_ip6_fini(void)
141140
{
142-
ebt_unregister_match(&filter_ip6);
141+
xt_unregister_match(&ebt_ip6_mt_reg);
143142
}
144143

145144
module_init(ebt_ip6_init);

‎net/bridge/netfilter/ebt_limit.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ ebt_limit_mt_check(const char *table, const void *e,
8989
return true;
9090
}
9191

92-
static struct ebt_match ebt_limit_reg __read_mostly = {
93-
.name = EBT_LIMIT_MATCH,
92+
static struct xt_match ebt_limit_mt_reg __read_mostly = {
93+
.name = "limit",
9494
.revision = 0,
9595
.family = NFPROTO_BRIDGE,
9696
.match = ebt_limit_mt,
@@ -101,12 +101,12 @@ static struct ebt_match ebt_limit_reg __read_mostly = {
101101

102102
static int __init ebt_limit_init(void)
103103
{
104-
return ebt_register_match(&ebt_limit_reg);
104+
return xt_register_match(&ebt_limit_mt_reg);
105105
}
106106

107107
static void __exit ebt_limit_fini(void)
108108
{
109-
ebt_unregister_match(&ebt_limit_reg);
109+
xt_unregister_match(&ebt_limit_mt_reg);
110110
}
111111

112112
module_init(ebt_limit_init);

0 commit comments

Comments
 (0)