diff options
author | Frédéric Leroy <fredo@starox.org> | 2010-11-15 07:57:56 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-11-15 07:57:56 -0500 |
commit | 9811600f7c1f18152430c6b93b0a76fdd88a59ce (patch) | |
tree | 1aee17451191f95b80f3c4ad319390cb8d546db4 /net | |
parent | 03c0e5bb34c9755ae4d955c97fba40b24e9c7fe7 (diff) |
netfilter: xt_CLASSIFY: add ARP support, allow CLASSIFY target on any table
Signed-off-by: Frédéric Leroy <fredo@starox.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_CLASSIFY.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/net/netfilter/xt_CLASSIFY.c b/net/netfilter/xt_CLASSIFY.c index c2c0e4abeb99..af9c4dadf816 100644 --- a/net/netfilter/xt_CLASSIFY.c +++ b/net/netfilter/xt_CLASSIFY.c | |||
@@ -19,12 +19,14 @@ | |||
19 | #include <linux/netfilter_ipv6.h> | 19 | #include <linux/netfilter_ipv6.h> |
20 | #include <linux/netfilter/x_tables.h> | 20 | #include <linux/netfilter/x_tables.h> |
21 | #include <linux/netfilter/xt_CLASSIFY.h> | 21 | #include <linux/netfilter/xt_CLASSIFY.h> |
22 | #include <linux/netfilter_arp.h> | ||
22 | 23 | ||
23 | MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); | 24 | MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); |
24 | MODULE_LICENSE("GPL"); | 25 | MODULE_LICENSE("GPL"); |
25 | MODULE_DESCRIPTION("Xtables: Qdisc classification"); | 26 | MODULE_DESCRIPTION("Xtables: Qdisc classification"); |
26 | MODULE_ALIAS("ipt_CLASSIFY"); | 27 | MODULE_ALIAS("ipt_CLASSIFY"); |
27 | MODULE_ALIAS("ip6t_CLASSIFY"); | 28 | MODULE_ALIAS("ip6t_CLASSIFY"); |
29 | MODULE_ALIAS("arpt_CLASSIFY"); | ||
28 | 30 | ||
29 | static unsigned int | 31 | static unsigned int |
30 | classify_tg(struct sk_buff *skb, const struct xt_action_param *par) | 32 | classify_tg(struct sk_buff *skb, const struct xt_action_param *par) |
@@ -35,26 +37,36 @@ classify_tg(struct sk_buff *skb, const struct xt_action_param *par) | |||
35 | return XT_CONTINUE; | 37 | return XT_CONTINUE; |
36 | } | 38 | } |
37 | 39 | ||
38 | static struct xt_target classify_tg_reg __read_mostly = { | 40 | static struct xt_target classify_tg_reg[] __read_mostly = { |
39 | .name = "CLASSIFY", | 41 | { |
40 | .revision = 0, | 42 | .name = "CLASSIFY", |
41 | .family = NFPROTO_UNSPEC, | 43 | .revision = 0, |
42 | .table = "mangle", | 44 | .family = NFPROTO_UNSPEC, |
43 | .hooks = (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) | | 45 | .hooks = (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) | |
44 | (1 << NF_INET_POST_ROUTING), | 46 | (1 << NF_INET_POST_ROUTING), |
45 | .target = classify_tg, | 47 | .target = classify_tg, |
46 | .targetsize = sizeof(struct xt_classify_target_info), | 48 | .targetsize = sizeof(struct xt_classify_target_info), |
47 | .me = THIS_MODULE, | 49 | .me = THIS_MODULE, |
50 | }, | ||
51 | { | ||
52 | .name = "CLASSIFY", | ||
53 | .revision = 0, | ||
54 | .family = NFPROTO_ARP, | ||
55 | .hooks = (1 << NF_ARP_OUT) | (1 << NF_ARP_FORWARD), | ||
56 | .target = classify_tg, | ||
57 | .targetsize = sizeof(struct xt_classify_target_info), | ||
58 | .me = THIS_MODULE, | ||
59 | }, | ||
48 | }; | 60 | }; |
49 | 61 | ||
50 | static int __init classify_tg_init(void) | 62 | static int __init classify_tg_init(void) |
51 | { | 63 | { |
52 | return xt_register_target(&classify_tg_reg); | 64 | return xt_register_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg)); |
53 | } | 65 | } |
54 | 66 | ||
55 | static void __exit classify_tg_exit(void) | 67 | static void __exit classify_tg_exit(void) |
56 | { | 68 | { |
57 | xt_unregister_target(&classify_tg_reg); | 69 | xt_unregister_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg)); |
58 | } | 70 | } |
59 | 71 | ||
60 | module_init(classify_tg_init); | 72 | module_init(classify_tg_init); |