aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_esp.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-08-22 03:34:04 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:55:32 -0400
commit4470bbc749e5551cce914529309456f631e25120 (patch)
tree972978df336c49235889dc745124fdfd1b990349 /net/netfilter/xt_esp.c
parent52d9c42ef2563d2c420eb23b96bf5a4cae9e167b (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.c51
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
95static struct xt_match esp_match = { 95static 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 },
105static 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
115static int __init xt_esp_init(void) 116static 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
129static void __exit xt_esp_cleanup(void) 121static 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
135module_init(xt_esp_init); 126module_init(xt_esp_init);