Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67b4af297033f5f65999885542f95ba7b562848a
Commit:     67b4af297033f5f65999885542f95ba7b562848a
Parent:     9dc0564e862b1b9a4677dec2c736b12169e03e99
Author:     Jan Engelhardt <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 1 00:01:50 2007 +1100
Committer:  Herbert Xu <[EMAIL PROTECTED]>
CommitDate: Sat Dec 1 00:01:50 2007 +1100

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
---
 net/netfilter/xt_CONNMARK.c    |   10 +++++-----
 net/netfilter/xt_CONNSECMARK.c |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/net/netfilter/xt_CONNMARK.c b/net/netfilter/xt_CONNMARK.c
index 856793e..0621ca7 100644
--- a/net/netfilter/xt_CONNMARK.c
+++ b/net/netfilter/xt_CONNMARK.c
@@ -86,11 +86,6 @@ checkentry(const char *tablename,
 {
        const struct xt_connmark_target_info *matchinfo = 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;
-       }
        if (matchinfo->mode == XT_CONNMARK_RESTORE) {
                if (strcmp(tablename, "mangle") != 0) {
                        printk(KERN_WARNING "CONNMARK: restore can only be "
@@ -103,6 +98,11 @@ checkentry(const char *tablename,
                printk(KERN_WARNING "CONNMARK: Only supports 32bit mark\n");
                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;
 }
 
diff --git a/net/netfilter/xt_CONNSECMARK.c b/net/netfilter/xt_CONNSECMARK.c
index 021b5c8..d8feba9 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;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to