File tree Expand file tree Collapse file tree 5 files changed +16
-24
lines changed Expand file tree Collapse file tree 5 files changed +16
-24
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,16 @@ static inline int nf_ct_get_ctinfo(const struct sk_buff *skb,
64
64
return (ct != NULL );
65
65
}
66
66
67
+ static inline int nf_ct_l3proto_try_module_get (unsigned short l3proto )
68
+ {
69
+ need_conntrack ();
70
+ return l3proto == PF_INET ? 0 : -1 ;
71
+ }
72
+
73
+ static inline void nf_ct_l3proto_module_put (unsigned short l3proto )
74
+ {
75
+ }
76
+
67
77
#else /* CONFIG_IP_NF_CONNTRACK */
68
78
69
79
#include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
Original file line number Diff line number Diff line change @@ -63,22 +63,18 @@ checkentry(const char *tablename,
63
63
printk (KERN_WARNING "connmark: only support 32bit mark\n" );
64
64
return 0 ;
65
65
}
66
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
67
66
if (nf_ct_l3proto_try_module_get (match -> family ) < 0 ) {
68
- printk (KERN_WARNING "can't load nf_conntrack support for "
67
+ printk (KERN_WARNING "can't load conntrack support for "
69
68
"proto=%d\n" , match -> family );
70
69
return 0 ;
71
70
}
72
- #endif
73
71
return 1 ;
74
72
}
75
73
76
74
static void
77
75
destroy (const struct xt_match * match , void * matchinfo )
78
76
{
79
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
80
77
nf_ct_l3proto_module_put (match -> family );
81
- #endif
82
78
}
83
79
84
80
#ifdef CONFIG_COMPAT
@@ -140,7 +136,6 @@ static struct xt_match xt_connmark_match[] = {
140
136
141
137
static int __init xt_connmark_init (void )
142
138
{
143
- need_conntrack ();
144
139
return xt_register_matches (xt_connmark_match ,
145
140
ARRAY_SIZE (xt_connmark_match ));
146
141
}
Original file line number Diff line number Diff line change 20
20
21
21
#include <linux/netfilter/x_tables.h>
22
22
#include <linux/netfilter/xt_conntrack.h>
23
+ #include <net/netfilter/nf_conntrack_compat.h>
23
24
24
25
MODULE_LICENSE ("GPL" );
25
26
MODULE_AUTHOR ("Marc Boucher <marc@mbsi.ca>" );
@@ -228,21 +229,17 @@ checkentry(const char *tablename,
228
229
void * matchinfo ,
229
230
unsigned int hook_mask )
230
231
{
231
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
232
232
if (nf_ct_l3proto_try_module_get (match -> family ) < 0 ) {
233
- printk (KERN_WARNING "can't load nf_conntrack support for "
233
+ printk (KERN_WARNING "can't load conntrack support for "
234
234
"proto=%d\n" , match -> family );
235
235
return 0 ;
236
236
}
237
- #endif
238
237
return 1 ;
239
238
}
240
239
241
240
static void destroy (const struct xt_match * match , void * matchinfo )
242
241
{
243
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
244
242
nf_ct_l3proto_module_put (match -> family );
245
- #endif
246
243
}
247
244
248
245
static struct xt_match conntrack_match = {
@@ -257,7 +254,6 @@ static struct xt_match conntrack_match = {
257
254
258
255
static int __init xt_conntrack_init (void )
259
256
{
260
- need_conntrack ();
261
257
return xt_register_match (& conntrack_match );
262
258
}
263
259
Original file line number Diff line number Diff line change 24
24
#endif
25
25
#include <linux/netfilter/x_tables.h>
26
26
#include <linux/netfilter/xt_helper.h>
27
+ #include <net/netfilter/nf_conntrack_compat.h>
27
28
28
29
MODULE_LICENSE ("GPL" );
29
30
MODULE_AUTHOR ("Martin Josefsson <gandalf@netfilter.org>" );
@@ -143,23 +144,19 @@ static int check(const char *tablename,
143
144
{
144
145
struct xt_helper_info * info = matchinfo ;
145
146
146
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
147
147
if (nf_ct_l3proto_try_module_get (match -> family ) < 0 ) {
148
- printk (KERN_WARNING "can't load nf_conntrack support for "
148
+ printk (KERN_WARNING "can't load conntrack support for "
149
149
"proto=%d\n" , match -> family );
150
150
return 0 ;
151
151
}
152
- #endif
153
152
info -> name [29 ] = '\0' ;
154
153
return 1 ;
155
154
}
156
155
157
156
static void
158
157
destroy (const struct xt_match * match , void * matchinfo )
159
158
{
160
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
161
159
nf_ct_l3proto_module_put (match -> family );
162
- #endif
163
160
}
164
161
165
162
static struct xt_match xt_helper_match [] = {
@@ -185,7 +182,6 @@ static struct xt_match xt_helper_match[] = {
185
182
186
183
static int __init xt_helper_init (void )
187
184
{
188
- need_conntrack ();
189
185
return xt_register_matches (xt_helper_match ,
190
186
ARRAY_SIZE (xt_helper_match ));
191
187
}
Original file line number Diff line number Diff line change @@ -50,22 +50,18 @@ static int check(const char *tablename,
50
50
void * matchinfo ,
51
51
unsigned int hook_mask )
52
52
{
53
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
54
53
if (nf_ct_l3proto_try_module_get (match -> family ) < 0 ) {
55
- printk (KERN_WARNING "can't load nf_conntrack support for "
54
+ printk (KERN_WARNING "can't load conntrack support for "
56
55
"proto=%d\n" , match -> family );
57
56
return 0 ;
58
57
}
59
- #endif
60
58
return 1 ;
61
59
}
62
60
63
61
static void
64
62
destroy (const struct xt_match * match , void * matchinfo )
65
63
{
66
- #if defined(CONFIG_NF_CONNTRACK ) || defined(CONFIG_NF_CONNTRACK_MODULE )
67
64
nf_ct_l3proto_module_put (match -> family );
68
- #endif
69
65
}
70
66
71
67
static struct xt_match xt_state_match [] = {
@@ -91,7 +87,6 @@ static struct xt_match xt_state_match[] = {
91
87
92
88
static int __init xt_state_init (void )
93
89
{
94
- need_conntrack ();
95
90
return xt_register_matches (xt_state_match , ARRAY_SIZE (xt_state_match ));
96
91
}
97
92
You can’t perform that action at this time.
0 commit comments