aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2006-03-22 16:55:40 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-22 16:55:40 -0500
commita45049c51ce6a3fecf2a909b591b28164c927112 (patch)
tree582c35205f9c1c12825447a009518eb2116beacd
parent4e3882f77376e036a52b022909d7e910714bd27b (diff)
[NETFILTER]: x_tables: set the protocol family in x_tables targets/matches
Set the family field in xt_[matches|targets] registered. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netfilter/x_tables.h8
-rw-r--r--include/linux/netfilter_arp/arp_tables.h6
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h14
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h14
-rw-r--r--net/ipv4/netfilter/arp_tables.c6
-rw-r--r--net/ipv4/netfilter/ip_tables.c15
-rw-r--r--net/ipv6/netfilter/ip6_tables.c15
-rw-r--r--net/netfilter/x_tables.c16
-rw-r--r--net/netfilter/xt_CLASSIFY.c12
-rw-r--r--net/netfilter/xt_CONNMARK.c12
-rw-r--r--net/netfilter/xt_MARK.c21
-rw-r--r--net/netfilter/xt_NFQUEUE.c19
-rw-r--r--net/netfilter/xt_NOTRACK.c12
-rw-r--r--net/netfilter/xt_comment.c12
-rw-r--r--net/netfilter/xt_connbytes.c12
-rw-r--r--net/netfilter/xt_connmark.c12
-rw-r--r--net/netfilter/xt_conntrack.c5
-rw-r--r--net/netfilter/xt_dccp.c12
-rw-r--r--net/netfilter/xt_helper.c12
-rw-r--r--net/netfilter/xt_length.c12
-rw-r--r--net/netfilter/xt_limit.c12
-rw-r--r--net/netfilter/xt_mac.c12
-rw-r--r--net/netfilter/xt_mark.c12
-rw-r--r--net/netfilter/xt_physdev.c12
-rw-r--r--net/netfilter/xt_pkttype.c12
-rw-r--r--net/netfilter/xt_policy.c12
-rw-r--r--net/netfilter/xt_realm.c5
-rw-r--r--net/netfilter/xt_sctp.c12
-rw-r--r--net/netfilter/xt_state.c12
-rw-r--r--net/netfilter/xt_string.c12
-rw-r--r--net/netfilter/xt_tcpmss.c12
-rw-r--r--net/netfilter/xt_tcpudp.c26
32 files changed, 235 insertions, 163 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 46a0f974f87c..bf71efb63007 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -220,10 +220,10 @@ struct xt_table_info
220 char *entries[NR_CPUS]; 220 char *entries[NR_CPUS];
221}; 221};
222 222
223extern int xt_register_target(int af, struct xt_target *target); 223extern int xt_register_target(struct xt_target *target);
224extern void xt_unregister_target(int af, struct xt_target *target); 224extern void xt_unregister_target(struct xt_target *target);
225extern int xt_register_match(int af, struct xt_match *target); 225extern int xt_register_match(struct xt_match *target);
226extern void xt_unregister_match(int af, struct xt_match *target); 226extern void xt_unregister_match(struct xt_match *target);
227 227
228extern int xt_check_match(const struct xt_match *match, unsigned short family, 228extern int xt_check_match(const struct xt_match *match, unsigned short family,
229 unsigned int size, const char *table, unsigned int hook, 229 unsigned int size, const char *table, unsigned int hook,
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index fd21796e5131..a27be05f67f0 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -263,8 +263,10 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
263 */ 263 */
264#ifdef __KERNEL__ 264#ifdef __KERNEL__
265 265
266#define arpt_register_target(tgt) xt_register_target(NF_ARP, tgt) 266#define arpt_register_target(tgt) \
267#define arpt_unregister_target(tgt) xt_unregister_target(NF_ARP, tgt) 267({ (tgt)->family = NF_ARP; \
268 xt_register_target(tgt); })
269#define arpt_unregister_target(tgt) xt_unregister_target(tgt)
268 270
269extern int arpt_register_table(struct arpt_table *table, 271extern int arpt_register_table(struct arpt_table *table,
270 const struct arpt_replace *repl); 272 const struct arpt_replace *repl);
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 76ba24b68515..ee262b5344e1 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -321,11 +321,15 @@ ipt_get_target(struct ipt_entry *e)
321#include <linux/init.h> 321#include <linux/init.h>
322extern void ipt_init(void) __init; 322extern void ipt_init(void) __init;
323 323
324#define ipt_register_target(tgt) xt_register_target(AF_INET, tgt) 324#define ipt_register_target(tgt) \
325#define ipt_unregister_target(tgt) xt_unregister_target(AF_INET, tgt) 325({ (tgt)->family = AF_INET; \
326 326 xt_register_target(tgt); })
327#define ipt_register_match(mtch) xt_register_match(AF_INET, mtch) 327#define ipt_unregister_target(tgt) xt_unregister_target(tgt)
328#define ipt_unregister_match(mtch) xt_unregister_match(AF_INET, mtch) 328
329#define ipt_register_match(mtch) \
330({ (mtch)->family = AF_INET; \
331 xt_register_match(mtch); })
332#define ipt_unregister_match(mtch) xt_unregister_match(mtch)
329 333
330//#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) 334//#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl)
331//#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) 335//#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl)
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index f249b574f0fa..7107f942eb05 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -334,11 +334,15 @@ ip6t_get_target(struct ip6t_entry *e)
334#include <linux/init.h> 334#include <linux/init.h>
335extern void ip6t_init(void) __init; 335extern void ip6t_init(void) __init;
336 336
337#define ip6t_register_target(tgt) xt_register_target(AF_INET6, tgt) 337#define ip6t_register_target(tgt) \
338#define ip6t_unregister_target(tgt) xt_unregister_target(AF_INET6, tgt) 338({ (tgt)->family = AF_INET6; \
339 339 xt_register_target(tgt); })
340#define ip6t_register_match(match) xt_register_match(AF_INET6, match) 340#define ip6t_unregister_target(tgt) xt_unregister_target(tgt)
341#define ip6t_unregister_match(match) xt_unregister_match(AF_INET6, match) 341
342#define ip6t_register_match(match) \
343({ (match)->family = AF_INET6; \
344 xt_register_match(match); })
345#define ip6t_unregister_match(match) xt_unregister_match(match)
342 346
343extern int ip6t_register_table(struct ip6t_table *table, 347extern int ip6t_register_table(struct ip6t_table *table,
344 const struct ip6t_replace *repl); 348 const struct ip6t_replace *repl);
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index f7efb3f27bf5..ff0c594a4198 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -1146,12 +1146,14 @@ void arpt_unregister_table(struct arpt_table *table)
1146static struct arpt_target arpt_standard_target = { 1146static struct arpt_target arpt_standard_target = {
1147 .name = ARPT_STANDARD_TARGET, 1147 .name = ARPT_STANDARD_TARGET,
1148 .targetsize = sizeof(int), 1148 .targetsize = sizeof(int),
1149 .family = NF_ARP,
1149}; 1150};
1150 1151
1151static struct arpt_target arpt_error_target = { 1152static struct arpt_target arpt_error_target = {
1152 .name = ARPT_ERROR_TARGET, 1153 .name = ARPT_ERROR_TARGET,
1153 .target = arpt_error, 1154 .target = arpt_error,
1154 .targetsize = ARPT_FUNCTION_MAXNAMELEN, 1155 .targetsize = ARPT_FUNCTION_MAXNAMELEN,
1156 .family = NF_ARP,
1155}; 1157};
1156 1158
1157static struct nf_sockopt_ops arpt_sockopts = { 1159static struct nf_sockopt_ops arpt_sockopts = {
@@ -1171,8 +1173,8 @@ static int __init init(void)
1171 xt_proto_init(NF_ARP); 1173 xt_proto_init(NF_ARP);
1172 1174
1173 /* Noone else will be downing sem now, so we won't sleep */ 1175 /* Noone else will be downing sem now, so we won't sleep */
1174 xt_register_target(NF_ARP, &arpt_standard_target); 1176 xt_register_target(&arpt_standard_target);
1175 xt_register_target(NF_ARP, &arpt_error_target); 1177 xt_register_target(&arpt_error_target);
1176 1178
1177 /* Register setsockopt */ 1179 /* Register setsockopt */
1178 ret = nf_register_sockopt(&arpt_sockopts); 1180 ret = nf_register_sockopt(&arpt_sockopts);
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 39705f9bc154..a7b194c4d79d 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -1335,12 +1335,14 @@ icmp_checkentry(const char *tablename,
1335static struct ipt_target ipt_standard_target = { 1335static struct ipt_target ipt_standard_target = {
1336 .name = IPT_STANDARD_TARGET, 1336 .name = IPT_STANDARD_TARGET,
1337 .targetsize = sizeof(int), 1337 .targetsize = sizeof(int),
1338 .family = AF_INET,
1338}; 1339};
1339 1340
1340static struct ipt_target ipt_error_target = { 1341static struct ipt_target ipt_error_target = {
1341 .name = IPT_ERROR_TARGET, 1342 .name = IPT_ERROR_TARGET,
1342 .target = ipt_error, 1343 .target = ipt_error,
1343 .targetsize = IPT_FUNCTION_MAXNAMELEN, 1344 .targetsize = IPT_FUNCTION_MAXNAMELEN,
1345 .family = AF_INET,
1344}; 1346};
1345 1347
1346static struct nf_sockopt_ops ipt_sockopts = { 1348static struct nf_sockopt_ops ipt_sockopts = {
@@ -1358,6 +1360,7 @@ static struct ipt_match icmp_matchstruct = {
1358 .match = icmp_match, 1360 .match = icmp_match,
1359 .matchsize = sizeof(struct ipt_icmp), 1361 .matchsize = sizeof(struct ipt_icmp),
1360 .proto = IPPROTO_ICMP, 1362 .proto = IPPROTO_ICMP,
1363 .family = AF_INET,
1361 .checkentry = icmp_checkentry, 1364 .checkentry = icmp_checkentry,
1362}; 1365};
1363 1366
@@ -1368,9 +1371,9 @@ static int __init init(void)
1368 xt_proto_init(AF_INET); 1371 xt_proto_init(AF_INET);
1369 1372
1370 /* Noone else will be downing sem now, so we won't sleep */ 1373 /* Noone else will be downing sem now, so we won't sleep */
1371 xt_register_target(AF_INET, &ipt_standard_target); 1374 xt_register_target(&ipt_standard_target);
1372 xt_register_target(AF_INET, &ipt_error_target); 1375 xt_register_target(&ipt_error_target);
1373 xt_register_match(AF_INET, &icmp_matchstruct); 1376 xt_register_match(&icmp_matchstruct);
1374 1377
1375 /* Register setsockopt */ 1378 /* Register setsockopt */
1376 ret = nf_register_sockopt(&ipt_sockopts); 1379 ret = nf_register_sockopt(&ipt_sockopts);
@@ -1387,9 +1390,9 @@ static void __exit fini(void)
1387{ 1390{
1388 nf_unregister_sockopt(&ipt_sockopts); 1391 nf_unregister_sockopt(&ipt_sockopts);
1389 1392
1390 xt_unregister_match(AF_INET, &icmp_matchstruct); 1393 xt_unregister_match(&icmp_matchstruct);
1391 xt_unregister_target(AF_INET, &ipt_error_target); 1394 xt_unregister_target(&ipt_error_target);
1392 xt_unregister_target(AF_INET, &ipt_standard_target); 1395 xt_unregister_target(&ipt_standard_target);
1393 1396
1394 xt_proto_fini(AF_INET); 1397 xt_proto_fini(AF_INET);
1395} 1398}
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 5a2063bda676..db3c9ae98e95 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1377,12 +1377,14 @@ icmp6_checkentry(const char *tablename,
1377static struct ip6t_target ip6t_standard_target = { 1377static struct ip6t_target ip6t_standard_target = {
1378 .name = IP6T_STANDARD_TARGET, 1378 .name = IP6T_STANDARD_TARGET,
1379 .targetsize = sizeof(int), 1379 .targetsize = sizeof(int),
1380 .family = AF_INET6,
1380}; 1381};
1381 1382
1382static struct ip6t_target ip6t_error_target = { 1383static struct ip6t_target ip6t_error_target = {
1383 .name = IP6T_ERROR_TARGET, 1384 .name = IP6T_ERROR_TARGET,
1384 .target = ip6t_error, 1385 .target = ip6t_error,
1385 .targetsize = IP6T_FUNCTION_MAXNAMELEN, 1386 .targetsize = IP6T_FUNCTION_MAXNAMELEN,
1387 .family = AF_INET6,
1386}; 1388};
1387 1389
1388static struct nf_sockopt_ops ip6t_sockopts = { 1390static struct nf_sockopt_ops ip6t_sockopts = {
@@ -1401,6 +1403,7 @@ static struct ip6t_match icmp6_matchstruct = {
1401 .matchsize = sizeof(struct ip6t_icmp), 1403 .matchsize = sizeof(struct ip6t_icmp),
1402 .checkentry = icmp6_checkentry, 1404 .checkentry = icmp6_checkentry,
1403 .proto = IPPROTO_ICMPV6, 1405 .proto = IPPROTO_ICMPV6,
1406 .family = AF_INET6,
1404}; 1407};
1405 1408
1406static int __init init(void) 1409static int __init init(void)
@@ -1410,9 +1413,9 @@ static int __init init(void)
1410 xt_proto_init(AF_INET6); 1413 xt_proto_init(AF_INET6);
1411 1414
1412 /* Noone else will be downing sem now, so we won't sleep */ 1415 /* Noone else will be downing sem now, so we won't sleep */
1413 xt_register_target(AF_INET6, &ip6t_standard_target); 1416 xt_register_target(&ip6t_standard_target);
1414 xt_register_target(AF_INET6, &ip6t_error_target); 1417 xt_register_target(&ip6t_error_target);
1415 xt_register_match(AF_INET6, &icmp6_matchstruct); 1418 xt_register_match(&icmp6_matchstruct);
1416 1419
1417 /* Register setsockopt */ 1420 /* Register setsockopt */
1418 ret = nf_register_sockopt(&ip6t_sockopts); 1421 ret = nf_register_sockopt(&ip6t_sockopts);
@@ -1429,9 +1432,9 @@ static int __init init(void)
1429static void __exit fini(void) 1432static void __exit fini(void)
1430{ 1433{
1431 nf_unregister_sockopt(&ip6t_sockopts); 1434 nf_unregister_sockopt(&ip6t_sockopts);
1432 xt_unregister_match(AF_INET6, &icmp6_matchstruct); 1435 xt_unregister_match(&icmp6_matchstruct);
1433 xt_unregister_target(AF_INET6, &ip6t_error_target); 1436 xt_unregister_target(&ip6t_error_target);
1434 xt_unregister_target(AF_INET6, &ip6t_standard_target); 1437 xt_unregister_target(&ip6t_standard_target);
1435 xt_proto_fini(AF_INET6); 1438 xt_proto_fini(AF_INET6);
1436} 1439}
1437 1440
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 750b92829766..0a29a24d9a72 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -60,9 +60,9 @@ static const char *xt_prefix[NPROTO] = {
60 60
61/* Registration hooks for targets. */ 61/* Registration hooks for targets. */
62int 62int
63xt_register_target(int af, struct xt_target *target) 63xt_register_target(struct xt_target *target)
64{ 64{
65 int ret; 65 int ret, af = target->family;
66 66
67 ret = down_interruptible(&xt[af].mutex); 67 ret = down_interruptible(&xt[af].mutex);
68 if (ret != 0) 68 if (ret != 0)
@@ -74,8 +74,10 @@ xt_register_target(int af, struct xt_target *target)
74EXPORT_SYMBOL(xt_register_target); 74EXPORT_SYMBOL(xt_register_target);
75 75
76void 76void
77xt_unregister_target(int af, struct xt_target *target) 77xt_unregister_target(struct xt_target *target)
78{ 78{
79 int af = target->family;
80
79 down(&xt[af].mutex); 81 down(&xt[af].mutex);
80 LIST_DELETE(&xt[af].target, target); 82 LIST_DELETE(&xt[af].target, target);
81 up(&xt[af].mutex); 83 up(&xt[af].mutex);
@@ -83,9 +85,9 @@ xt_unregister_target(int af, struct xt_target *target)
83EXPORT_SYMBOL(xt_unregister_target); 85EXPORT_SYMBOL(xt_unregister_target);
84 86
85int 87int
86xt_register_match(int af, struct xt_match *match) 88xt_register_match(struct xt_match *match)
87{ 89{
88 int ret; 90 int ret, af = match->family;
89 91
90 ret = down_interruptible(&xt[af].mutex); 92 ret = down_interruptible(&xt[af].mutex);
91 if (ret != 0) 93 if (ret != 0)
@@ -99,8 +101,10 @@ xt_register_match(int af, struct xt_match *match)
99EXPORT_SYMBOL(xt_register_match); 101EXPORT_SYMBOL(xt_register_match);
100 102
101void 103void
102xt_unregister_match(int af, struct xt_match *match) 104xt_unregister_match(struct xt_match *match)
103{ 105{
106 int af = match->family;
107
104 down(&xt[af].mutex); 108 down(&xt[af].mutex);
105 LIST_DELETE(&xt[af].match, match); 109 LIST_DELETE(&xt[af].match, match);
106 up(&xt[af].mutex); 110 up(&xt[af].mutex);
diff --git a/net/netfilter/xt_CLASSIFY.c b/net/netfilter/xt_CLASSIFY.c
index 3224ed87d4c7..3cd2ac90a25b 100644
--- a/net/netfilter/xt_CLASSIFY.c
+++ b/net/netfilter/xt_CLASSIFY.c
@@ -47,6 +47,7 @@ static struct xt_target classify_reg = {
47 .table = "mangle", 47 .table = "mangle",
48 .hooks = (1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) | 48 .hooks = (1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) |
49 (1 << NF_IP_POST_ROUTING), 49 (1 << NF_IP_POST_ROUTING),
50 .family = AF_INET,
50 .me = THIS_MODULE, 51 .me = THIS_MODULE,
51}; 52};
52static struct xt_target classify6_reg = { 53static struct xt_target classify6_reg = {
@@ -56,6 +57,7 @@ static struct xt_target classify6_reg = {
56 .table = "mangle", 57 .table = "mangle",
57 .hooks = (1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) | 58 .hooks = (1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) |
58 (1 << NF_IP_POST_ROUTING), 59 (1 << NF_IP_POST_ROUTING),
60 .family = AF_INET6,
59 .me = THIS_MODULE, 61 .me = THIS_MODULE,
60}; 62};
61 63
@@ -64,21 +66,21 @@ static int __init init(void)
64{ 66{
65 int ret; 67 int ret;
66 68
67 ret = xt_register_target(AF_INET, &classify_reg); 69 ret = xt_register_target(&classify_reg);
68 if (ret) 70 if (ret)
69 return ret; 71 return ret;
70 72
71 ret = xt_register_target(AF_INET6, &classify6_reg); 73 ret = xt_register_target(&classify6_reg);
72 if (ret) 74 if (ret)
73 xt_unregister_target(AF_INET, &classify_reg); 75 xt_unregister_target(&classify_reg);
74 76
75 return ret; 77 return ret;
76} 78}
77 79
78static void __exit fini(void) 80static void __exit fini(void)
79{ 81{
80 xt_unregister_target(AF_INET, &classify_reg); 82 xt_unregister_target(&classify_reg);
81 xt_unregister_target(AF_INET6, &classify6_reg); 83 xt_unregister_target(&classify6_reg);
82} 84}
83 85
84module_init(init); 86module_init(init);
diff --git a/net/netfilter/xt_CONNMARK.c b/net/netfilter/xt_CONNMARK.c
index df2486a3efd5..35448b8e6883 100644
--- a/net/netfilter/xt_CONNMARK.c
+++ b/net/netfilter/xt_CONNMARK.c
@@ -102,6 +102,7 @@ static struct xt_target connmark_reg = {
102 .target = target, 102 .target = target,
103 .targetsize = sizeof(struct xt_connmark_target_info), 103 .targetsize = sizeof(struct xt_connmark_target_info),
104 .checkentry = checkentry, 104 .checkentry = checkentry,
105 .family = AF_INET,
105 .me = THIS_MODULE 106 .me = THIS_MODULE
106}; 107};
107 108
@@ -110,6 +111,7 @@ static struct xt_target connmark6_reg = {
110 .target = target, 111 .target = target,
111 .targetsize = sizeof(struct xt_connmark_target_info), 112 .targetsize = sizeof(struct xt_connmark_target_info),
112 .checkentry = checkentry, 113 .checkentry = checkentry,
114 .family = AF_INET6,
113 .me = THIS_MODULE 115 .me = THIS_MODULE
114}; 116};
115 117
@@ -119,21 +121,21 @@ static int __init init(void)
119 121
120 need_conntrack(); 122 need_conntrack();
121 123
122 ret = xt_register_target(AF_INET, &connmark_reg); 124 ret = xt_register_target(&connmark_reg);
123 if (ret) 125 if (ret)
124 return ret; 126 return ret;
125 127
126 ret = xt_register_target(AF_INET6, &connmark6_reg); 128 ret = xt_register_target(&connmark6_reg);
127 if (ret) 129 if (ret)
128 xt_unregister_target(AF_INET, &connmark_reg); 130 xt_unregister_target(&connmark_reg);
129 131
130 return ret; 132 return ret;
131} 133}
132 134
133static void __exit fini(void) 135static void __exit fini(void)
134{ 136{
135 xt_unregister_target(AF_INET, &connmark_reg); 137 xt_unregister_target(&connmark_reg);
136 xt_unregister_target(AF_INET6, &connmark6_reg); 138 xt_unregister_target(&connmark6_reg);
137} 139}
138 140
139module_init(init); 141module_init(init);
diff --git a/net/netfilter/xt_MARK.c b/net/netfilter/xt_MARK.c
index dcb5266efae0..73bdd5c80e17 100644
--- a/net/netfilter/xt_MARK.c
+++ b/net/netfilter/xt_MARK.c
@@ -119,6 +119,7 @@ static struct xt_target ipt_mark_reg_v0 = {
119 .table = "mangle", 119 .table = "mangle",
120 .checkentry = checkentry_v0, 120 .checkentry = checkentry_v0,
121 .me = THIS_MODULE, 121 .me = THIS_MODULE,
122 .family = AF_INET,
122 .revision = 0, 123 .revision = 0,
123}; 124};
124 125
@@ -129,6 +130,7 @@ static struct xt_target ipt_mark_reg_v1 = {
129 .table = "mangle", 130 .table = "mangle",
130 .checkentry = checkentry_v1, 131 .checkentry = checkentry_v1,
131 .me = THIS_MODULE, 132 .me = THIS_MODULE,
133 .family = AF_INET,
132 .revision = 1, 134 .revision = 1,
133}; 135};
134 136
@@ -139,6 +141,7 @@ static struct xt_target ip6t_mark_reg_v0 = {
139 .table = "mangle", 141 .table = "mangle",
140 .checkentry = checkentry_v0, 142 .checkentry = checkentry_v0,
141 .me = THIS_MODULE, 143 .me = THIS_MODULE,
144 .family = AF_INET6,
142 .revision = 0, 145 .revision = 0,
143}; 146};
144 147
@@ -146,18 +149,18 @@ static int __init init(void)
146{ 149{
147 int err; 150 int err;
148 151
149 err = xt_register_target(AF_INET, &ipt_mark_reg_v0); 152 err = xt_register_target(&ipt_mark_reg_v0);
150 if (err) 153 if (err)
151 return err; 154 return err;
152 155
153 err = xt_register_target(AF_INET, &ipt_mark_reg_v1); 156 err = xt_register_target(&ipt_mark_reg_v1);
154 if (err) 157 if (err)
155 xt_unregister_target(AF_INET, &ipt_mark_reg_v0); 158 xt_unregister_target(&ipt_mark_reg_v0);
156 159
157 err = xt_register_target(AF_INET6, &ip6t_mark_reg_v0); 160 err = xt_register_target(&ip6t_mark_reg_v0);
158 if (err) { 161 if (err) {
159 xt_unregister_target(AF_INET, &ipt_mark_reg_v0); 162 xt_unregister_target(&ipt_mark_reg_v0);
160 xt_unregister_target(AF_INET, &ipt_mark_reg_v1); 163 xt_unregister_target(&ipt_mark_reg_v1);
161 } 164 }
162 165
163 return err; 166 return err;
@@ -165,9 +168,9 @@ static int __init init(void)
165 168
166static void __exit fini(void) 169static void __exit fini(void)
167{ 170{
168 xt_unregister_target(AF_INET, &ipt_mark_reg_v0); 171 xt_unregister_target(&ipt_mark_reg_v0);
169 xt_unregister_target(AF_INET, &ipt_mark_reg_v1); 172 xt_unregister_target(&ipt_mark_reg_v1);
170 xt_unregister_target(AF_INET6, &ip6t_mark_reg_v0); 173 xt_unregister_target(&ip6t_mark_reg_v0);
171} 174}
172 175
173module_init(init); 176module_init(init);
diff --git a/net/netfilter/xt_NFQUEUE.c b/net/netfilter/xt_NFQUEUE.c
index 39a963edf16b..2873e1c60f68 100644
--- a/net/netfilter/xt_NFQUEUE.c
+++ b/net/netfilter/xt_NFQUEUE.c
@@ -41,6 +41,7 @@ static struct xt_target ipt_NFQ_reg = {
41 .name = "NFQUEUE", 41 .name = "NFQUEUE",
42 .target = target, 42 .target = target,
43 .targetsize = sizeof(struct xt_NFQ_info), 43 .targetsize = sizeof(struct xt_NFQ_info),
44 .family = AF_INET,
44 .me = THIS_MODULE, 45 .me = THIS_MODULE,
45}; 46};
46 47
@@ -48,6 +49,7 @@ static struct xt_target ip6t_NFQ_reg = {
48 .name = "NFQUEUE", 49 .name = "NFQUEUE",
49 .target = target, 50 .target = target,
50 .targetsize = sizeof(struct xt_NFQ_info), 51 .targetsize = sizeof(struct xt_NFQ_info),
52 .family = AF_INET6,
51 .me = THIS_MODULE, 53 .me = THIS_MODULE,
52}; 54};
53 55
@@ -55,36 +57,37 @@ static struct xt_target arpt_NFQ_reg = {
55 .name = "NFQUEUE", 57 .name = "NFQUEUE",
56 .target = target, 58 .target = target,
57 .targetsize = sizeof(struct xt_NFQ_info), 59 .targetsize = sizeof(struct xt_NFQ_info),
60 .family = NF_ARP,
58 .me = THIS_MODULE, 61 .me = THIS_MODULE,
59}; 62};
60 63
61static int __init init(void) 64static int __init init(void)
62{ 65{
63 int ret; 66 int ret;
64 ret = xt_register_target(AF_INET, &ipt_NFQ_reg); 67 ret = xt_register_target(&ipt_NFQ_reg);
65 if (ret) 68 if (ret)
66 return ret; 69 return ret;
67 ret = xt_register_target(AF_INET6, &ip6t_NFQ_reg); 70 ret = xt_register_target(&ip6t_NFQ_reg);
68 if (ret) 71 if (ret)
69 goto out_ip; 72 goto out_ip;
70 ret = xt_register_target(NF_ARP, &arpt_NFQ_reg); 73 ret = xt_register_target(&arpt_NFQ_reg);
71 if (ret) 74 if (ret)
72 goto out_ip6; 75 goto out_ip6;
73 76
74 return ret; 77 return ret;
75out_ip6: 78out_ip6:
76 xt_unregister_target(AF_INET6, &ip6t_NFQ_reg); 79 xt_unregister_target(&ip6t_NFQ_reg);
77out_ip: 80out_ip:
78 xt_unregister_target(AF_INET, &ipt_NFQ_reg); 81 xt_unregister_target(&ipt_NFQ_reg);
79 82
80 return ret; 83 return ret;
81} 84}
82 85
83static void __exit fini(void) 86static void __exit fini(void)
84{ 87{
85 xt_unregister_target(NF_ARP, &arpt_NFQ_reg); 88 xt_unregister_target(&arpt_NFQ_reg);
86 xt_unregister_target(AF_INET6, &ip6t_NFQ_reg); 89 xt_unregister_target(&ip6t_NFQ_reg);
87 xt_unregister_target(AF_INET, &ipt_NFQ_reg); 90 xt_unregister_target(&ipt_NFQ_reg);
88} 91}
89 92
90module_init(init); 93module_init(init);
diff --git a/net/netfilter/xt_NOTRACK.c b/net/netfilter/xt_NOTRACK.c
index b8634e3f6169..cf2ebd76fd6f 100644
--- a/net/netfilter/xt_NOTRACK.c
+++ b/net/netfilter/xt_NOTRACK.c
@@ -39,6 +39,7 @@ static struct xt_target notrack_reg = {
39 .target = target, 39 .target = target,
40 .targetsize = 0, 40 .targetsize = 0,
41 .table = "raw", 41 .table = "raw",
42 .family = AF_INET,
42 .me = THIS_MODULE, 43 .me = THIS_MODULE,
43}; 44};
44 45
@@ -47,6 +48,7 @@ static struct xt_target notrack6_reg = {
47 .target = target, 48 .target = target,
48 .targetsize = 0, 49 .targetsize = 0,
49 .table = "raw", 50 .table = "raw",
51 .family = AF_INET6,
50 .me = THIS_MODULE, 52 .me = THIS_MODULE,
51}; 53};
52 54
@@ -54,21 +56,21 @@ static int __init init(void)
54{ 56{
55 int ret; 57 int ret;
56 58
57 ret = xt_register_target(AF_INET, &notrack_reg); 59 ret = xt_register_target(&notrack_reg);
58 if (ret) 60 if (ret)
59 return ret; 61 return ret;
60 62
61 ret = xt_register_target(AF_INET6, &notrack6_reg); 63 ret = xt_register_target(&notrack6_reg);
62 if (ret) 64 if (ret)
63 xt_unregister_target(AF_INET, &notrack_reg); 65 xt_unregister_target(&notrack_reg);
64 66
65 return ret; 67 return ret;
66} 68}
67 69
68static void __exit fini(void) 70static void __exit fini(void)
69{ 71{
70 xt_unregister_target(AF_INET6, &notrack6_reg); 72 xt_unregister_target(&notrack6_reg);
71 xt_unregister_target(AF_INET, &notrack_reg); 73 xt_unregister_target(&notrack_reg);
72} 74}
73 75
74module_init(init); 76module_init(init);
diff --git a/net/netfilter/xt_comment.c b/net/netfilter/xt_comment.c
index 03d9d741231c..2637724b498d 100644
--- a/net/netfilter/xt_comment.c
+++ b/net/netfilter/xt_comment.c
@@ -33,6 +33,7 @@ static struct xt_match comment_match = {
33 .name = "comment", 33 .name = "comment",
34 .match = match, 34 .match = match,
35 .matchsize = sizeof(struct xt_comment_info), 35 .matchsize = sizeof(struct xt_comment_info),
36 .family = AF_INET,
36 .me = THIS_MODULE 37 .me = THIS_MODULE
37}; 38};
38 39
@@ -40,6 +41,7 @@ static struct xt_match comment6_match = {
40 .name = "comment", 41 .name = "comment",
41 .match = match, 42 .match = match,
42 .matchsize = sizeof(struct xt_comment_info), 43 .matchsize = sizeof(struct xt_comment_info),
44 .family = AF_INET6,
43 .me = THIS_MODULE 45 .me = THIS_MODULE
44}; 46};
45 47
@@ -47,21 +49,21 @@ static int __init init(void)
47{ 49{
48 int ret; 50 int ret;
49 51
50 ret = xt_register_match(AF_INET, &comment_match); 52 ret = xt_register_match(&comment_match);
51 if (ret) 53 if (ret)
52 return ret; 54 return ret;
53 55
54 ret = xt_register_match(AF_INET6, &comment6_match); 56 ret = xt_register_match(&comment6_match);
55 if (ret) 57 if (ret)
56 xt_unregister_match(AF_INET, &comment_match); 58 xt_unregister_match(&comment_match);
57 59
58 return ret; 60 return ret;
59} 61}
60 62
61static void __exit fini(void) 63static void __exit fini(void)
62{ 64{
63 xt_unregister_match(AF_INET, &comment_match); 65 xt_unregister_match(&comment_match);
64 xt_unregister_match(AF_INET6, &comment6_match); 66 xt_unregister_match(&comment6_match);
65} 67}
66 68
67module_init(init); 69module_init(init);
diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c
index f34ecb9485c7..4985f5ec58ca 100644
--- a/net/netfilter/xt_connbytes.c
+++ b/net/netfilter/xt_connbytes.c
@@ -148,6 +148,7 @@ static struct xt_match connbytes_match = {
148 .match = match, 148 .match = match,
149 .checkentry = check, 149 .checkentry = check,
150 .matchsize = sizeof(struct xt_connbytes_info), 150 .matchsize = sizeof(struct xt_connbytes_info),
151 .family = AF_INET,
151 .me = THIS_MODULE 152 .me = THIS_MODULE
152}; 153};
153static struct xt_match connbytes6_match = { 154static struct xt_match connbytes6_match = {
@@ -155,26 +156,27 @@ static struct xt_match connbytes6_match = {
155 .match = match, 156 .match = match,
156 .checkentry = check, 157 .checkentry = check,
157 .matchsize = sizeof(struct xt_connbytes_info), 158 .matchsize = sizeof(struct xt_connbytes_info),
159 .family = AF_INET6,
158 .me = THIS_MODULE 160 .me = THIS_MODULE
159}; 161};
160 162
161static int __init init(void) 163static int __init init(void)
162{ 164{
163 int ret; 165 int ret;
164 ret = xt_register_match(AF_INET, &connbytes_match); 166 ret = xt_register_match(&connbytes_match);
165 if (ret) 167 if (ret)
166 return ret; 168 return ret;
167 169
168 ret = xt_register_match(AF_INET6, &connbytes6_match); 170 ret = xt_register_match(&connbytes6_match);
169 if (ret) 171 if (ret)
170 xt_unregister_match(AF_INET, &connbytes_match); 172 xt_unregister_match(&connbytes_match);
171 return ret; 173 return ret;
172} 174}
173 175
174static void __exit fini(void) 176static void __exit fini(void)
175{ 177{
176 xt_unregister_match(AF_INET, &connbytes_match); 178 xt_unregister_match(&connbytes_match);
177 xt_unregister_match(AF_INET6, &connbytes6_match); 179 xt_unregister_match(&connbytes6_match);
178} 180}
179 181
180module_init(init); 182module_init(init);
diff --git a/net/netfilter/xt_connmark.c b/net/netfilter/xt_connmark.c
index 51822471e919..e810600345e3 100644
--- a/net/netfilter/xt_connmark.c
+++ b/net/netfilter/xt_connmark.c
@@ -72,6 +72,7 @@ static struct xt_match connmark_match = {
72 .match = match, 72 .match = match,
73 .matchsize = sizeof(struct xt_connmark_info), 73 .matchsize = sizeof(struct xt_connmark_info),
74 .checkentry = checkentry, 74 .checkentry = checkentry,
75 .family = AF_INET,
75 .me = THIS_MODULE 76 .me = THIS_MODULE
76}; 77};
77 78
@@ -80,6 +81,7 @@ static struct xt_match connmark6_match = {
80 .match = match, 81 .match = match,
81 .matchsize = sizeof(struct xt_connmark_info), 82 .matchsize = sizeof(struct xt_connmark_info),
82 .checkentry = checkentry, 83 .checkentry = checkentry,
84 .family = AF_INET6,
83 .me = THIS_MODULE 85 .me = THIS_MODULE
84}; 86};
85 87
@@ -89,20 +91,20 @@ static int __init init(void)
89 91
90 need_conntrack(); 92 need_conntrack();
91 93
92 ret = xt_register_match(AF_INET, &connmark_match); 94 ret = xt_register_match(&connmark_match);
93 if (ret) 95 if (ret)
94 return ret; 96 return ret;
95 97
96 ret = xt_register_match(AF_INET6, &connmark6_match); 98 ret = xt_register_match(&connmark6_match);
97 if (ret) 99 if (ret)
98 xt_unregister_match(AF_INET, &connmark_match); 100 xt_unregister_match(&connmark_match);
99 return ret; 101 return ret;
100} 102}
101 103
102static void __exit fini(void) 104static void __exit fini(void)
103{ 105{
104 xt_unregister_match(AF_INET6, &connmark6_match); 106 xt_unregister_match(&connmark6_match);
105 xt_unregister_match(AF_INET, &connmark_match); 107 xt_unregister_match(&connmark_match);
106} 108}
107 109
108module_init(init); 110module_init(init);
diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c
index 39fc29496e00..7d20caa0d605 100644
--- a/net/netfilter/xt_conntrack.c
+++ b/net/netfilter/xt_conntrack.c
@@ -207,6 +207,7 @@ static struct xt_match conntrack_match = {
207 .name = "conntrack", 207 .name = "conntrack",
208 .match = match, 208 .match = match,
209 .matchsize = sizeof(struct xt_conntrack_info), 209 .matchsize = sizeof(struct xt_conntrack_info),
210 .family = AF_INET,
210 .me = THIS_MODULE, 211 .me = THIS_MODULE,
211}; 212};
212 213
@@ -214,14 +215,14 @@ static int __init init(void)
214{ 215{
215 int ret; 216 int ret;
216 need_conntrack(); 217 need_conntrack();
217 ret = xt_register_match(AF_INET, &conntrack_match); 218 ret = xt_register_match(&conntrack_match);
218 219
219 return ret; 220 return ret;
220} 221}
221 222
222static void __exit fini(void) 223static void __exit fini(void)
223{ 224{
224 xt_unregister_match(AF_INET, &conntrack_match); 225 xt_unregister_match(&conntrack_match);
225} 226}
226 227
227module_init(init); 228module_init(init);
diff --git a/net/netfilter/xt_dccp.c b/net/netfilter/xt_dccp.c
index db6b70cdc770..2f331decd151 100644
--- a/net/netfilter/xt_dccp.c
+++ b/net/netfilter/xt_dccp.c
@@ -149,6 +149,7 @@ static struct xt_match dccp_match =
149 .matchsize = sizeof(struct xt_dccp_info), 149 .matchsize = sizeof(struct xt_dccp_info),
150 .proto = IPPROTO_DCCP, 150 .proto = IPPROTO_DCCP,
151 .checkentry = checkentry, 151 .checkentry = checkentry,
152 .family = AF_INET,
152 .me = THIS_MODULE, 153 .me = THIS_MODULE,
153}; 154};
154static struct xt_match dccp6_match = 155static struct xt_match dccp6_match =
@@ -158,6 +159,7 @@ static struct xt_match dccp6_match =
158 .matchsize = sizeof(struct xt_dccp_info), 159 .matchsize = sizeof(struct xt_dccp_info),
159 .proto = IPPROTO_DCCP, 160 .proto = IPPROTO_DCCP,
160 .checkentry = checkentry, 161 .checkentry = checkentry,
162 .family = AF_INET6,
161 .me = THIS_MODULE, 163 .me = THIS_MODULE,
162}; 164};
163 165
@@ -172,17 +174,17 @@ static int __init init(void)
172 dccp_optbuf = kmalloc(256 * 4, GFP_KERNEL); 174 dccp_optbuf = kmalloc(256 * 4, GFP_KERNEL);
173 if (!dccp_optbuf) 175 if (!dccp_optbuf)
174 return -ENOMEM; 176 return -ENOMEM;
175 ret = xt_register_match(AF_INET, &dccp_match); 177 ret = xt_register_match(&dccp_match);
176 if (ret) 178 if (ret)
177 goto out_kfree; 179 goto out_kfree;
178 ret = xt_register_match(AF_INET6, &dccp6_match); 180 ret = xt_register_match(&dccp6_match);
179 if (ret) 181 if (ret)
180 goto out_unreg; 182 goto out_unreg;
181 183
182 return ret; 184 return ret;
183 185
184out_unreg: 186out_unreg:
185 xt_unregister_match(AF_INET, &dccp_match); 187 xt_unregister_match(&dccp_match);
186out_kfree: 188out_kfree:
187 kfree(dccp_optbuf); 189 kfree(dccp_optbuf);
188 190
@@ -191,8 +193,8 @@ out_kfree:
191 193
192static void __exit fini(void) 194static void __exit fini(void)
193{ 195{
194 xt_unregister_match(AF_INET6, &dccp6_match); 196 xt_unregister_match(&dccp6_match);
195 xt_unregister_match(AF_INET, &dccp_match); 197 xt_unregister_match(&dccp_match);
196 kfree(dccp_optbuf); 198 kfree(dccp_optbuf);
197} 199}
198 200
diff --git a/net/netfilter/xt_helper.c b/net/netfilter/xt_helper.c
index ef8e54d40c92..7d2d68b9155f 100644
--- a/net/netfilter/xt_helper.c
+++ b/net/netfilter/xt_helper.c
@@ -153,6 +153,7 @@ static struct xt_match helper_match = {
153 .match = match, 153 .match = match,
154 .matchsize = sizeof(struct xt_helper_info), 154 .matchsize = sizeof(struct xt_helper_info),
155 .checkentry = check, 155 .checkentry = check,
156 .family = AF_INET,
156 .me = THIS_MODULE, 157 .me = THIS_MODULE,
157}; 158};
158static struct xt_match helper6_match = { 159static struct xt_match helper6_match = {
@@ -160,6 +161,7 @@ static struct xt_match helper6_match = {
160 .match = match, 161 .match = match,
161 .matchsize = sizeof(struct xt_helper_info), 162 .matchsize = sizeof(struct xt_helper_info),
162 .checkentry = check, 163 .checkentry = check,
164 .family = AF_INET6,
163 .me = THIS_MODULE, 165 .me = THIS_MODULE,
164}; 166};
165 167
@@ -168,21 +170,21 @@ static int __init init(void)
168 int ret; 170 int ret;
169 need_conntrack(); 171 need_conntrack();
170 172
171 ret = xt_register_match(AF_INET, &helper_match); 173 ret = xt_register_match(&helper_match);
172 if (ret < 0) 174 if (ret < 0)
173 return ret; 175 return ret;
174 176
175 ret = xt_register_match(AF_INET6, &helper6_match); 177 ret = xt_register_match(&helper6_match);
176 if (ret < 0) 178 if (ret < 0)
177 xt_unregister_match(AF_INET, &helper_match); 179 xt_unregister_match(&helper_match);
178 180
179 return ret; 181 return ret;
180} 182}
181 183
182static void __exit fini(void) 184static void __exit fini(void)
183{ 185{
184 xt_unregister_match(AF_INET, &helper_match); 186 xt_unregister_match(&helper_match);
185 xt_unregister_match(AF_INET6, &helper6_match); 187 xt_unregister_match(&helper6_match);
186} 188}
187 189
188module_init(init); 190module_init(init);
diff --git a/net/netfilter/xt_length.c b/net/netfilter/xt_length.c
index b9e60f041a64..38560caef757 100644
--- a/net/netfilter/xt_length.c
+++ b/net/netfilter/xt_length.c
@@ -56,6 +56,7 @@ static struct xt_match length_match = {
56 .name = "length", 56 .name = "length",
57 .match = match, 57 .match = match,
58 .matchsize = sizeof(struct xt_length_info), 58 .matchsize = sizeof(struct xt_length_info),
59 .family = AF_INET,
59 .me = THIS_MODULE, 60 .me = THIS_MODULE,
60}; 61};
61 62
@@ -63,26 +64,27 @@ static struct xt_match length6_match = {
63 .name = "length", 64 .name = "length",
64 .match = match6, 65 .match = match6,
65 .matchsize = sizeof(struct xt_length_info), 66 .matchsize = sizeof(struct xt_length_info),
67 .family = AF_INET6,
66 .me = THIS_MODULE, 68 .me = THIS_MODULE,
67}; 69};
68 70
69static int __init init(void) 71static int __init init(void)
70{ 72{
71 int ret; 73 int ret;
72 ret = xt_register_match(AF_INET, &length_match); 74 ret = xt_register_match(&length_match);
73 if (ret) 75 if (ret)
74 return ret; 76 return ret;
75 ret = xt_register_match(AF_INET6, &length6_match); 77 ret = xt_register_match(&length6_match);
76 if (ret) 78 if (ret)
77 xt_unregister_match(AF_INET, &length_match); 79 xt_unregister_match(&length_match);
78 80
79 return ret; 81 return ret;
80} 82}
81 83
82static void __exit fini(void) 84static void __exit fini(void)
83{ 85{
84 xt_unregister_match(AF_INET, &length_match); 86 xt_unregister_match(&length_match);
85 xt_unregister_match(AF_INET6, &length6_match); 87 xt_unregister_match(&length6_match);
86} 88}
87 89
88module_init(init); 90module_init(init);
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c
index 3049e6f8889e..e91c1a444e77 100644
--- a/net/netfilter/xt_limit.c
+++ b/net/netfilter/xt_limit.c
@@ -141,6 +141,7 @@ static struct xt_match ipt_limit_reg = {
141 .match = ipt_limit_match, 141 .match = ipt_limit_match,
142 .matchsize = sizeof(struct xt_rateinfo), 142 .matchsize = sizeof(struct xt_rateinfo),
143 .checkentry = ipt_limit_checkentry, 143 .checkentry = ipt_limit_checkentry,
144 .family = AF_INET,
144 .me = THIS_MODULE, 145 .me = THIS_MODULE,
145}; 146};
146static struct xt_match limit6_reg = { 147static struct xt_match limit6_reg = {
@@ -148,6 +149,7 @@ static struct xt_match limit6_reg = {
148 .match = ipt_limit_match, 149 .match = ipt_limit_match,
149 .matchsize = sizeof(struct xt_rateinfo), 150 .matchsize = sizeof(struct xt_rateinfo),
150 .checkentry = ipt_limit_checkentry, 151 .checkentry = ipt_limit_checkentry,
152 .family = AF_INET6,
151 .me = THIS_MODULE, 153 .me = THIS_MODULE,
152}; 154};
153 155
@@ -155,21 +157,21 @@ static int __init init(void)
155{ 157{
156 int ret; 158 int ret;
157 159
158 ret = xt_register_match(AF_INET, &ipt_limit_reg); 160 ret = xt_register_match(&ipt_limit_reg);
159 if (ret) 161 if (ret)
160 return ret; 162 return ret;
161 163
162 ret = xt_register_match(AF_INET6, &limit6_reg); 164 ret = xt_register_match(&limit6_reg);
163 if (ret) 165 if (ret)
164 xt_unregister_match(AF_INET, &ipt_limit_reg); 166 xt_unregister_match(&ipt_limit_reg);
165 167
166 return ret; 168 return ret;
167} 169}
168 170
169static void __exit fini(void) 171static void __exit fini(void)
170{ 172{
171 xt_unregister_match(AF_INET, &ipt_limit_reg); 173 xt_unregister_match(&ipt_limit_reg);
172 xt_unregister_match(AF_INET6, &limit6_reg); 174 xt_unregister_match(&limit6_reg);
173} 175}
174 176
175module_init(init); 177module_init(init);
diff --git a/net/netfilter/xt_mac.c b/net/netfilter/xt_mac.c
index b4559a46dce8..f4defa28a6ec 100644
--- a/net/netfilter/xt_mac.c
+++ b/net/netfilter/xt_mac.c
@@ -49,6 +49,7 @@ static struct xt_match mac_match = {
49 .matchsize = sizeof(struct xt_mac_info), 49 .matchsize = sizeof(struct xt_mac_info),
50 .hooks = (1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_LOCAL_IN) | 50 .hooks = (1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_LOCAL_IN) |
51 (1 << NF_IP_FORWARD), 51 (1 << NF_IP_FORWARD),
52 .family = AF_INET,
52 .me = THIS_MODULE, 53 .me = THIS_MODULE,
53}; 54};
54static struct xt_match mac6_match = { 55static struct xt_match mac6_match = {
@@ -57,27 +58,28 @@ static struct xt_match mac6_match = {
57 .matchsize = sizeof(struct xt_mac_info), 58 .matchsize = sizeof(struct xt_mac_info),
58 .hooks = (1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_LOCAL_IN) | 59 .hooks = (1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_LOCAL_IN) |
59 (1 << NF_IP_FORWARD), 60 (1 << NF_IP_FORWARD),
61 .family = AF_INET6,
60 .me = THIS_MODULE, 62 .me = THIS_MODULE,
61}; 63};
62 64
63static int __init init(void) 65static int __init init(void)
64{ 66{
65 int ret; 67 int ret;
66 ret = xt_register_match(AF_INET, &mac_match); 68 ret = xt_register_match(&mac_match);
67 if (ret) 69 if (ret)
68 return ret; 70 return ret;
69 71
70 ret = xt_register_match(AF_INET6, &mac6_match); 72 ret = xt_register_match(&mac6_match);
71 if (ret) 73 if (ret)
72 xt_unregister_match(AF_INET, &mac_match); 74 xt_unregister_match(&mac_match);
73 75
74 return ret; 76 return ret;
75} 77}
76 78
77static void __exit fini(void) 79static void __exit fini(void)
78{ 80{
79 xt_unregister_match(AF_INET, &mac_match); 81 xt_unregister_match(&mac_match);
80 xt_unregister_match(AF_INET6, &mac6_match); 82 xt_unregister_match(&mac6_match);
81} 83}
82 84
83module_init(init); 85module_init(init);
diff --git a/net/netfilter/xt_mark.c b/net/netfilter/xt_mark.c
index c1a8f0f587f0..ce0badfeef9a 100644
--- a/net/netfilter/xt_mark.c
+++ b/net/netfilter/xt_mark.c
@@ -56,6 +56,7 @@ static struct xt_match mark_match = {
56 .match = match, 56 .match = match,
57 .matchsize = sizeof(struct xt_mark_info), 57 .matchsize = sizeof(struct xt_mark_info),
58 .checkentry = checkentry, 58 .checkentry = checkentry,
59 .family = AF_INET,
59 .me = THIS_MODULE, 60 .me = THIS_MODULE,
60}; 61};
61 62
@@ -64,27 +65,28 @@ static struct xt_match mark6_match = {
64 .match = match, 65 .match = match,
65 .matchsize = sizeof(struct xt_mark_info), 66 .matchsize = sizeof(struct xt_mark_info),
66 .checkentry = checkentry, 67 .checkentry = checkentry,
68 .family = AF_INET6,
67 .me = THIS_MODULE, 69 .me = THIS_MODULE,
68}; 70};
69 71
70static int __init init(void) 72static int __init init(void)
71{ 73{
72 int ret; 74 int ret;
73 ret = xt_register_match(AF_INET, &mark_match); 75 ret = xt_register_match(&mark_match);
74 if (ret) 76 if (ret)
75 return ret; 77 return ret;
76 78
77 ret = xt_register_match(AF_INET6, &mark6_match); 79 ret = xt_register_match(&mark6_match);
78 if (ret) 80 if (ret)
79 xt_unregister_match(AF_INET, &mark_match); 81 xt_unregister_match(&mark_match);
80 82
81 return ret; 83 return ret;
82} 84}
83 85
84static void __exit fini(void) 86static void __exit fini(void)
85{ 87{
86 xt_unregister_match(AF_INET, &mark_match); 88 xt_unregister_match(&mark_match);
87 xt_unregister_match(AF_INET6, &mark6_match); 89 xt_unregister_match(&mark6_match);
88} 90}
89 91
90module_init(init); 92module_init(init);
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index f788e8e76254..089f4f7e8636 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -121,6 +121,7 @@ static struct xt_match physdev_match = {
121 .match = match, 121 .match = match,
122 .matchsize = sizeof(struct xt_physdev_info), 122 .matchsize = sizeof(struct xt_physdev_info),
123 .checkentry = checkentry, 123 .checkentry = checkentry,
124 .family = AF_INET,
124 .me = THIS_MODULE, 125 .me = THIS_MODULE,
125}; 126};
126 127
@@ -129,6 +130,7 @@ static struct xt_match physdev6_match = {
129 .match = match, 130 .match = match,
130 .matchsize = sizeof(struct xt_physdev_info), 131 .matchsize = sizeof(struct xt_physdev_info),
131 .checkentry = checkentry, 132 .checkentry = checkentry,
133 .family = AF_INET6,
132 .me = THIS_MODULE, 134 .me = THIS_MODULE,
133}; 135};
134 136
@@ -136,21 +138,21 @@ static int __init init(void)
136{ 138{
137 int ret; 139 int ret;
138 140
139 ret = xt_register_match(AF_INET, &physdev_match); 141 ret = xt_register_match(&physdev_match);
140 if (ret < 0) 142 if (ret < 0)
141 return ret; 143 return ret;
142 144
143 ret = xt_register_match(AF_INET6, &physdev6_match); 145 ret = xt_register_match(&physdev6_match);
144 if (ret < 0) 146 if (ret < 0)
145 xt_unregister_match(AF_INET, &physdev_match); 147 xt_unregister_match(&physdev_match);
146 148
147 return ret; 149 return ret;
148} 150}
149 151
150static void __exit fini(void) 152static void __exit fini(void)
151{ 153{
152 xt_unregister_match(AF_INET, &physdev_match); 154 xt_unregister_match(&physdev_match);
153 xt_unregister_match(AF_INET6, &physdev6_match); 155 xt_unregister_match(&physdev6_match);
154} 156}
155 157
156module_init(init); 158module_init(init);
diff --git a/net/netfilter/xt_pkttype.c b/net/netfilter/xt_pkttype.c
index f38638dfd139..8b8bca988ac6 100644
--- a/net/netfilter/xt_pkttype.c
+++ b/net/netfilter/xt_pkttype.c
@@ -37,6 +37,7 @@ static struct xt_match pkttype_match = {
37 .name = "pkttype", 37 .name = "pkttype",
38 .match = match, 38 .match = match,
39 .matchsize = sizeof(struct xt_pkttype_info), 39 .matchsize = sizeof(struct xt_pkttype_info),
40 .family = AF_INET,
40 .me = THIS_MODULE, 41 .me = THIS_MODULE,
41}; 42};
42 43
@@ -44,27 +45,28 @@ static struct xt_match pkttype6_match = {
44 .name = "pkttype", 45 .name = "pkttype",
45 .match = match, 46 .match = match,
46 .matchsize = sizeof(struct xt_pkttype_info), 47 .matchsize = sizeof(struct xt_pkttype_info),
48 .family = AF_INET6,
47 .me = THIS_MODULE, 49 .me = THIS_MODULE,
48}; 50};
49 51
50static int __init init(void) 52static int __init init(void)
51{ 53{
52 int ret; 54 int ret;
53 ret = xt_register_match(AF_INET, &pkttype_match); 55 ret = xt_register_match(&pkttype_match);
54 if (ret) 56 if (ret)
55 return ret; 57 return ret;
56 58
57 ret = xt_register_match(AF_INET6, &pkttype6_match); 59 ret = xt_register_match(&pkttype6_match);
58 if (ret) 60 if (ret)
59 xt_unregister_match(AF_INET, &pkttype_match); 61 xt_unregister_match(&pkttype_match);
60 62
61 return ret; 63 return ret;
62} 64}
63 65
64static void __exit fini(void) 66static void __exit fini(void)
65{ 67{
66 xt_unregister_match(AF_INET, &pkttype_match); 68 xt_unregister_match(&pkttype_match);
67 xt_unregister_match(AF_INET6, &pkttype6_match); 69 xt_unregister_match(&pkttype6_match);
68} 70}
69 71
70module_init(init); 72module_init(init);
diff --git a/net/netfilter/xt_policy.c b/net/netfilter/xt_policy.c
index 1ec22082f04d..d57a611ae0d3 100644
--- a/net/netfilter/xt_policy.c
+++ b/net/netfilter/xt_policy.c
@@ -172,6 +172,7 @@ static struct xt_match policy_match = {
172 .match = match, 172 .match = match,
173 .matchsize = sizeof(struct xt_policy_info), 173 .matchsize = sizeof(struct xt_policy_info),
174 .checkentry = checkentry, 174 .checkentry = checkentry,
175 .family = AF_INET,
175 .me = THIS_MODULE, 176 .me = THIS_MODULE,
176}; 177};
177 178
@@ -181,6 +182,7 @@ static struct xt_match policy6_match = {
181 .match = match, 182 .match = match,
182 .matchsize = sizeof(struct xt_policy_info), 183 .matchsize = sizeof(struct xt_policy_info),
183 .checkentry = checkentry, 184 .checkentry = checkentry,
185 .family = AF_INET6,
184 .me = THIS_MODULE, 186 .me = THIS_MODULE,
185}; 187};
186 188
@@ -188,19 +190,19 @@ static int __init init(void)
188{ 190{
189 int ret; 191 int ret;
190 192
191 ret = xt_register_match(AF_INET, &policy_match); 193 ret = xt_register_match(&policy_match);
192 if (ret) 194 if (ret)
193 return ret; 195 return ret;
194 ret = xt_register_match(AF_INET6, &policy6_match); 196 ret = xt_register_match(&policy6_match);
195 if (ret) 197 if (ret)
196 xt_unregister_match(AF_INET, &policy_match); 198 xt_unregister_match(&policy_match);
197 return ret; 199 return ret;
198} 200}
199 201
200static void __exit fini(void) 202static void __exit fini(void)
201{ 203{
202 xt_unregister_match(AF_INET6, &policy6_match); 204 xt_unregister_match(&policy6_match);
203 xt_unregister_match(AF_INET, &policy_match); 205 xt_unregister_match(&policy_match);
204} 206}
205 207
206module_init(init); 208module_init(init);
diff --git a/net/netfilter/xt_realm.c b/net/netfilter/xt_realm.c
index 57815a07db67..5e31a4a835bf 100644
--- a/net/netfilter/xt_realm.c
+++ b/net/netfilter/xt_realm.c
@@ -45,17 +45,18 @@ static struct xt_match realm_match = {
45 .matchsize = sizeof(struct xt_realm_info), 45 .matchsize = sizeof(struct xt_realm_info),
46 .hooks = (1 << NF_IP_POST_ROUTING) | (1 << NF_IP_FORWARD) | 46 .hooks = (1 << NF_IP_POST_ROUTING) | (1 << NF_IP_FORWARD) |
47 (1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_LOCAL_IN), 47 (1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_LOCAL_IN),
48 .family = AF_INET,
48 .me = THIS_MODULE 49 .me = THIS_MODULE
49}; 50};
50 51
51static int __init init(void) 52static int __init init(void)
52{ 53{
53 return xt_register_match(AF_INET, &realm_match); 54 return xt_register_match(&realm_match);
54} 55}
55 56
56static void __exit fini(void) 57static void __exit fini(void)
57{ 58{
58 xt_unregister_match(AF_INET, &realm_match); 59 xt_unregister_match(&realm_match);
59} 60}
60 61
61module_init(init); 62module_init(init);
diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c
index f5d698ba03ca..c6eb24a2fe13 100644
--- a/net/netfilter/xt_sctp.c
+++ b/net/netfilter/xt_sctp.c
@@ -186,6 +186,7 @@ static struct xt_match sctp_match = {
186 .matchsize = sizeof(struct xt_sctp_info), 186 .matchsize = sizeof(struct xt_sctp_info),
187 .proto = IPPROTO_SCTP, 187 .proto = IPPROTO_SCTP,
188 .checkentry = checkentry, 188 .checkentry = checkentry,
189 .family = AF_INET,
189 .me = THIS_MODULE 190 .me = THIS_MODULE
190}; 191};
191 192
@@ -195,27 +196,28 @@ static struct xt_match sctp6_match = {
195 .matchsize = sizeof(struct xt_sctp_info), 196 .matchsize = sizeof(struct xt_sctp_info),
196 .proto = IPPROTO_SCTP, 197 .proto = IPPROTO_SCTP,
197 .checkentry = checkentry, 198 .checkentry = checkentry,
199 .family = AF_INET6,
198 .me = THIS_MODULE 200 .me = THIS_MODULE
199}; 201};
200 202
201static int __init init(void) 203static int __init init(void)
202{ 204{
203 int ret; 205 int ret;
204 ret = xt_register_match(AF_INET, &sctp_match); 206 ret = xt_register_match(&sctp_match);
205 if (ret) 207 if (ret)
206 return ret; 208 return ret;
207 209
208 ret = xt_register_match(AF_INET6, &sctp6_match); 210 ret = xt_register_match(&sctp6_match);
209 if (ret) 211 if (ret)
210 xt_unregister_match(AF_INET, &sctp_match); 212 xt_unregister_match(&sctp_match);
211 213
212 return ret; 214 return ret;
213} 215}
214 216
215static void __exit fini(void) 217static void __exit fini(void)
216{ 218{
217 xt_unregister_match(AF_INET6, &sctp6_match); 219 xt_unregister_match(&sctp6_match);
218 xt_unregister_match(AF_INET, &sctp_match); 220 xt_unregister_match(&sctp_match);
219} 221}
220 222
221module_init(init); 223module_init(init);
diff --git a/net/netfilter/xt_state.c b/net/netfilter/xt_state.c
index b8ec00cd51fc..7cd557c932ba 100644
--- a/net/netfilter/xt_state.c
+++ b/net/netfilter/xt_state.c
@@ -48,6 +48,7 @@ static struct xt_match state_match = {
48 .name = "state", 48 .name = "state",
49 .match = match, 49 .match = match,
50 .matchsize = sizeof(struct xt_state_info), 50 .matchsize = sizeof(struct xt_state_info),
51 .family = AF_INET,
51 .me = THIS_MODULE, 52 .me = THIS_MODULE,
52}; 53};
53 54
@@ -55,6 +56,7 @@ static struct xt_match state6_match = {
55 .name = "state", 56 .name = "state",
56 .match = match, 57 .match = match,
57 .matchsize = sizeof(struct xt_state_info), 58 .matchsize = sizeof(struct xt_state_info),
59 .family = AF_INET6,
58 .me = THIS_MODULE, 60 .me = THIS_MODULE,
59}; 61};
60 62
@@ -64,21 +66,21 @@ static int __init init(void)
64 66
65 need_conntrack(); 67 need_conntrack();
66 68
67 ret = xt_register_match(AF_INET, &state_match); 69 ret = xt_register_match(&state_match);
68 if (ret < 0) 70 if (ret < 0)
69 return ret; 71 return ret;
70 72
71 ret = xt_register_match(AF_INET6, &state6_match); 73 ret = xt_register_match(&state6_match);
72 if (ret < 0) 74 if (ret < 0)
73 xt_unregister_match(AF_INET,&state_match); 75 xt_unregister_match(&state_match);
74 76
75 return ret; 77 return ret;
76} 78}
77 79
78static void __exit fini(void) 80static void __exit fini(void)
79{ 81{
80 xt_unregister_match(AF_INET, &state_match); 82 xt_unregister_match(&state_match);
81 xt_unregister_match(AF_INET6, &state6_match); 83 xt_unregister_match(&state6_match);
82} 84}
83 85
84module_init(init); 86module_init(init);
diff --git a/net/netfilter/xt_string.c b/net/netfilter/xt_string.c
index fccbad6a7f40..703d80fccacf 100644
--- a/net/netfilter/xt_string.c
+++ b/net/netfilter/xt_string.c
@@ -78,6 +78,7 @@ static struct xt_match string_match = {
78 .matchsize = sizeof(struct xt_string_info), 78 .matchsize = sizeof(struct xt_string_info),
79 .checkentry = checkentry, 79 .checkentry = checkentry,
80 .destroy = destroy, 80 .destroy = destroy,
81 .family = AF_INET,
81 .me = THIS_MODULE 82 .me = THIS_MODULE
82}; 83};
83static struct xt_match string6_match = { 84static struct xt_match string6_match = {
@@ -86,6 +87,7 @@ static struct xt_match string6_match = {
86 .matchsize = sizeof(struct xt_string_info), 87 .matchsize = sizeof(struct xt_string_info),
87 .checkentry = checkentry, 88 .checkentry = checkentry,
88 .destroy = destroy, 89 .destroy = destroy,
90 .family = AF_INET6,
89 .me = THIS_MODULE 91 .me = THIS_MODULE
90}; 92};
91 93
@@ -93,20 +95,20 @@ static int __init init(void)
93{ 95{
94 int ret; 96 int ret;
95 97
96 ret = xt_register_match(AF_INET, &string_match); 98 ret = xt_register_match(&string_match);
97 if (ret) 99 if (ret)
98 return ret; 100 return ret;
99 ret = xt_register_match(AF_INET6, &string6_match); 101 ret = xt_register_match(&string6_match);
100 if (ret) 102 if (ret)
101 xt_unregister_match(AF_INET, &string_match); 103 xt_unregister_match(&string_match);
102 104
103 return ret; 105 return ret;
104} 106}
105 107
106static void __exit fini(void) 108static void __exit fini(void)
107{ 109{
108 xt_unregister_match(AF_INET, &string_match); 110 xt_unregister_match(&string_match);
109 xt_unregister_match(AF_INET6, &string6_match); 111 xt_unregister_match(&string6_match);
110} 112}
111 113
112module_init(init); 114module_init(init);
diff --git a/net/netfilter/xt_tcpmss.c b/net/netfilter/xt_tcpmss.c
index 4925fc98f4ae..70a8858ae3f1 100644
--- a/net/netfilter/xt_tcpmss.c
+++ b/net/netfilter/xt_tcpmss.c
@@ -98,6 +98,7 @@ static struct xt_match tcpmss_match = {
98 .match = match, 98 .match = match,
99 .matchsize = sizeof(struct xt_tcpmss_match_info), 99 .matchsize = sizeof(struct xt_tcpmss_match_info),
100 .proto = IPPROTO_TCP, 100 .proto = IPPROTO_TCP,
101 .family = AF_INET,
101 .me = THIS_MODULE, 102 .me = THIS_MODULE,
102}; 103};
103 104
@@ -106,6 +107,7 @@ static struct xt_match tcpmss6_match = {
106 .match = match, 107 .match = match,
107 .matchsize = sizeof(struct xt_tcpmss_match_info), 108 .matchsize = sizeof(struct xt_tcpmss_match_info),
108 .proto = IPPROTO_TCP, 109 .proto = IPPROTO_TCP,
110 .family = AF_INET6,
109 .me = THIS_MODULE, 111 .me = THIS_MODULE,
110}; 112};
111 113
@@ -113,21 +115,21 @@ static struct xt_match tcpmss6_match = {
113static int __init init(void) 115static int __init init(void)
114{ 116{
115 int ret; 117 int ret;
116 ret = xt_register_match(AF_INET, &tcpmss_match); 118 ret = xt_register_match(&tcpmss_match);
117 if (ret) 119 if (ret)
118 return ret; 120 return ret;
119 121
120 ret = xt_register_match(AF_INET6, &tcpmss6_match); 122 ret = xt_register_match(&tcpmss6_match);
121 if (ret) 123 if (ret)
122 xt_unregister_match(AF_INET, &tcpmss_match); 124 xt_unregister_match(&tcpmss_match);
123 125
124 return ret; 126 return ret;
125} 127}
126 128
127static void __exit fini(void) 129static void __exit fini(void)
128{ 130{
129 xt_unregister_match(AF_INET6, &tcpmss6_match); 131 xt_unregister_match(&tcpmss6_match);
130 xt_unregister_match(AF_INET, &tcpmss_match); 132 xt_unregister_match(&tcpmss_match);
131} 133}
132 134
133module_init(init); 135module_init(init);
diff --git a/net/netfilter/xt_tcpudp.c b/net/netfilter/xt_tcpudp.c
index b5cd0dd4e41f..14a990eb666a 100644
--- a/net/netfilter/xt_tcpudp.c
+++ b/net/netfilter/xt_tcpudp.c
@@ -204,6 +204,7 @@ static struct xt_match tcp_matchstruct = {
204 .match = tcp_match, 204 .match = tcp_match,
205 .matchsize = sizeof(struct xt_tcp), 205 .matchsize = sizeof(struct xt_tcp),
206 .proto = IPPROTO_TCP, 206 .proto = IPPROTO_TCP,
207 .family = AF_INET,
207 .checkentry = tcp_checkentry, 208 .checkentry = tcp_checkentry,
208 .me = THIS_MODULE, 209 .me = THIS_MODULE,
209}; 210};
@@ -213,6 +214,7 @@ static struct xt_match tcp6_matchstruct = {
213 .match = tcp_match, 214 .match = tcp_match,
214 .matchsize = sizeof(struct xt_tcp), 215 .matchsize = sizeof(struct xt_tcp),
215 .proto = IPPROTO_TCP, 216 .proto = IPPROTO_TCP,
217 .family = AF_INET6,
216 .checkentry = tcp_checkentry, 218 .checkentry = tcp_checkentry,
217 .me = THIS_MODULE, 219 .me = THIS_MODULE,
218}; 220};
@@ -222,6 +224,7 @@ static struct xt_match udp_matchstruct = {
222 .match = udp_match, 224 .match = udp_match,
223 .matchsize = sizeof(struct xt_udp), 225 .matchsize = sizeof(struct xt_udp),
224 .proto = IPPROTO_UDP, 226 .proto = IPPROTO_UDP,
227 .family = AF_INET,
225 .checkentry = udp_checkentry, 228 .checkentry = udp_checkentry,
226 .me = THIS_MODULE, 229 .me = THIS_MODULE,
227}; 230};
@@ -230,6 +233,7 @@ static struct xt_match udp6_matchstruct = {
230 .match = udp_match, 233 .match = udp_match,
231 .matchsize = sizeof(struct xt_udp), 234 .matchsize = sizeof(struct xt_udp),
232 .proto = IPPROTO_UDP, 235 .proto = IPPROTO_UDP,
236 .family = AF_INET6,
233 .checkentry = udp_checkentry, 237 .checkentry = udp_checkentry,
234 .me = THIS_MODULE, 238 .me = THIS_MODULE,
235}; 239};
@@ -237,39 +241,39 @@ static struct xt_match udp6_matchstruct = {
237static int __init init(void) 241static int __init init(void)
238{ 242{
239 int ret; 243 int ret;
240 ret = xt_register_match(AF_INET, &tcp_matchstruct); 244 ret = xt_register_match(&tcp_matchstruct);
241 if (ret) 245 if (ret)
242 return ret; 246 return ret;
243 247
244 ret = xt_register_match(AF_INET6, &tcp6_matchstruct); 248 ret = xt_register_match(&tcp6_matchstruct);
245 if (ret) 249 if (ret)
246 goto out_unreg_tcp; 250 goto out_unreg_tcp;
247 251
248 ret = xt_register_match(AF_INET, &udp_matchstruct); 252 ret = xt_register_match(&udp_matchstruct);
249 if (ret) 253 if (ret)
250 goto out_unreg_tcp6; 254 goto out_unreg_tcp6;
251 255
252 ret = xt_register_match(AF_INET6, &udp6_matchstruct); 256 ret = xt_register_match(&udp6_matchstruct);
253 if (ret) 257 if (ret)
254 goto out_unreg_udp; 258 goto out_unreg_udp;
255 259
256 return ret; 260 return ret;
257 261
258out_unreg_udp: 262out_unreg_udp:
259 xt_unregister_match(AF_INET, &tcp_matchstruct); 263 xt_unregister_match(&tcp_matchstruct);
260out_unreg_tcp6: 264out_unreg_tcp6:
261 xt_unregister_match(AF_INET6, &tcp6_matchstruct); 265 xt_unregister_match(&tcp6_matchstruct);
262out_unreg_tcp: 266out_unreg_tcp:
263 xt_unregister_match(AF_INET, &tcp_matchstruct); 267 xt_unregister_match(&tcp_matchstruct);
264 return ret; 268 return ret;
265} 269}
266 270
267static void __exit fini(void) 271static void __exit fini(void)
268{ 272{
269 xt_unregister_match(AF_INET6, &udp6_matchstruct); 273 xt_unregister_match(&udp6_matchstruct);
270 xt_unregister_match(AF_INET, &udp_matchstruct); 274 xt_unregister_match(&udp_matchstruct);
271 xt_unregister_match(AF_INET6, &tcp6_matchstruct); 275 xt_unregister_match(&tcp6_matchstruct);
272 xt_unregister_match(AF_INET, &tcp_matchstruct); 276 xt_unregister_match(&tcp_matchstruct);
273} 277}
274 278
275module_init(init); 279module_init(init);