Re: [PATCH 2/3] netfilter: xt_connbytes: Force CT accounting to be enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tim Gardner wrote:
On 06/24/2010 11:15 AM, Jan Engelhardt wrote:

On Thursday 2010-06-24 17:27, Tim Gardner wrote:
diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c
index 7351783..b0cda8c 100644
--- a/net/netfilter/xt_connbytes.c
+++ b/net/netfilter/xt_connbytes.c
@@ -112,6 +112,16 @@ static int connbytes_mt_check(const struct xt_mtchk_param *par)
    if (ret<  0)
        pr_info("cannot load conntrack support for proto=%u\n",
            par->family);
+
+    /*
+ * This filter cannot function correctly unless connection tracking + * accounting is enabled, so complain in the hope that someone notices.
+     */
+    if (nf_ct_acct_enabled(par) == false) {

    if (!nfct_acct_enabled(par)) {

+        pr_warning("Forcing CT accounting to be enabled\n");
+        nf_ct_set_acct(par, true);
+    }
+
    return ret;
}
--

meh, I suppose portability isn't the issue it once was with respect to boolean and signed integers. Here is the combined 1 and 2 patches. If its sufficient I'll resend the pull request as a V4.


Looks fine to me.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux