diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2006-03-22 16:55:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-22 16:55:40 -0500 |
commit | a45049c51ce6a3fecf2a909b591b28164c927112 (patch) | |
tree | 582c35205f9c1c12825447a009518eb2116beacd /net/ipv4 | |
parent | 4e3882f77376e036a52b022909d7e910714bd27b (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>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 6 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 15 |
2 files changed, 13 insertions, 8 deletions
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) | |||
1146 | static struct arpt_target arpt_standard_target = { | 1146 | static 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 | ||
1151 | static struct arpt_target arpt_error_target = { | 1152 | static 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 | ||
1157 | static struct nf_sockopt_ops arpt_sockopts = { | 1159 | static 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, | |||
1335 | static struct ipt_target ipt_standard_target = { | 1335 | static 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 | ||
1340 | static struct ipt_target ipt_error_target = { | 1341 | static 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 | ||
1346 | static struct nf_sockopt_ops ipt_sockopts = { | 1348 | static 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 | } |