diff options
author | Patrick McHardy <kaber@trash.net> | 2006-08-22 03:34:04 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:55:32 -0400 |
commit | 4470bbc749e5551cce914529309456f631e25120 (patch) | |
tree | 972978df336c49235889dc745124fdfd1b990349 /net/netfilter/xt_esp.c | |
parent | 52d9c42ef2563d2c420eb23b96bf5a4cae9e167b (diff) |
[NETFILTER]: x_tables: make use of mass registation helpers
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/xt_esp.c')
-rw-r--r-- | net/netfilter/xt_esp.c | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/net/netfilter/xt_esp.c b/net/netfilter/xt_esp.c index 9dad6281e0c..7b19bc9ea20 100644 --- a/net/netfilter/xt_esp.c +++ b/net/netfilter/xt_esp.c | |||
@@ -92,44 +92,35 @@ checkentry(const char *tablename, | |||
92 | return 1; | 92 | return 1; |
93 | } | 93 | } |
94 | 94 | ||
95 | static struct xt_match esp_match = { | 95 | static struct xt_match xt_esp_match[] = { |
96 | .name = "esp", | 96 | { |
97 | .family = AF_INET, | 97 | .name = "esp", |
98 | .proto = IPPROTO_ESP, | 98 | .family = AF_INET, |
99 | .match = &match, | 99 | .checkentry = checkentry, |
100 | .matchsize = sizeof(struct xt_esp), | 100 | .match = match, |
101 | .checkentry = &checkentry, | 101 | .matchsize = sizeof(struct xt_esp), |
102 | .me = THIS_MODULE, | 102 | .proto = IPPROTO_ESP, |
103 | }; | 103 | .me = THIS_MODULE, |
104 | 104 | }, | |
105 | static struct xt_match esp6_match = { | 105 | { |
106 | .name = "esp", | 106 | .name = "esp", |
107 | .family = AF_INET6, | 107 | .family = AF_INET6, |
108 | .proto = IPPROTO_ESP, | 108 | .checkentry = checkentry, |
109 | .match = &match, | 109 | .match = match, |
110 | .matchsize = sizeof(struct xt_esp), | 110 | .matchsize = sizeof(struct xt_esp), |
111 | .checkentry = &checkentry, | 111 | .proto = IPPROTO_ESP, |
112 | .me = THIS_MODULE, | 112 | .me = THIS_MODULE, |
113 | }, | ||
113 | }; | 114 | }; |
114 | 115 | ||
115 | static int __init xt_esp_init(void) | 116 | static int __init xt_esp_init(void) |
116 | { | 117 | { |
117 | int ret; | 118 | return xt_register_matches(xt_esp_match, ARRAY_SIZE(xt_esp_match)); |
118 | ret = xt_register_match(&esp_match); | ||
119 | if (ret) | ||
120 | return ret; | ||
121 | |||
122 | ret = xt_register_match(&esp6_match); | ||
123 | if (ret) | ||
124 | xt_unregister_match(&esp_match); | ||
125 | |||
126 | return ret; | ||
127 | } | 119 | } |
128 | 120 | ||
129 | static void __exit xt_esp_cleanup(void) | 121 | static void __exit xt_esp_cleanup(void) |
130 | { | 122 | { |
131 | xt_unregister_match(&esp_match); | 123 | xt_unregister_matches(xt_esp_match, ARRAY_SIZE(xt_esp_match)); |
132 | xt_unregister_match(&esp6_match); | ||
133 | } | 124 | } |
134 | 125 | ||
135 | module_init(xt_esp_init); | 126 | module_init(xt_esp_init); |