aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_CONNSECMARK.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@computergmbh.de>2007-12-01 00:01:50 +1100
committerHerbert Xu <herbert@gondor.apana.org.au>2007-12-01 00:01:50 +1100
commit67b4af297033f5f65999885542f95ba7b562848a (patch)
treefc719bd0cd194a496d05ff5e0816cbc06e9d1727 /net/netfilter/xt_CONNSECMARK.c
parent[NETFILTER]: xt_TCPMSS: remove network triggerable WARN_ON (diff)
downloadlinux-dev-67b4af297033f5f65999885542f95ba7b562848a.tar.xz
linux-dev-67b4af297033f5f65999885542f95ba7b562848a.zip
[NETFILTER]: fix forgotten module release in xt_CONNMARK and xt_CONNSECMARK
Fix forgotten module release in xt_CONNMARK and xt_CONNSECMARK When xt_CONNMARK is used outside the mangle table and the user specified "--restore-mark", the connmark_tg_check() function will (correctly) error out, but (incorrectly) forgets to release the L3 conntrack module. Same for xt_CONNSECMARK. Fix is to move the call to acquire the L3 module after the basic constraint checks. Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/netfilter/xt_CONNSECMARK.c')
-rw-r--r--net/netfilter/xt_CONNSECMARK.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/netfilter/xt_CONNSECMARK.c b/net/netfilter/xt_CONNSECMARK.c
index 021b5c8d20e2..d8feba9bdb48 100644
--- a/net/netfilter/xt_CONNSECMARK.c
+++ b/net/netfilter/xt_CONNSECMARK.c
@@ -90,11 +90,6 @@ static bool checkentry(const char *tablename, const void *entry,
{
const struct xt_connsecmark_target_info *info = targinfo;
- if (nf_ct_l3proto_try_module_get(target->family) < 0) {
- printk(KERN_WARNING "can't load conntrack support for "
- "proto=%d\n", target->family);
- return false;
- }
switch (info->mode) {
case CONNSECMARK_SAVE:
case CONNSECMARK_RESTORE:
@@ -105,6 +100,11 @@ static bool checkentry(const char *tablename, const void *entry,
return false;
}
+ if (nf_ct_l3proto_try_module_get(target->family) < 0) {
+ printk(KERN_WARNING "can't load conntrack support for "
+ "proto=%d\n", target->family);
+ return false;
+ }
return true;
}