From: Patrick McHardy <kaber@trash.net>
To: 李伟华 <liweihuahot@hotmail.com>
Cc: netfilter@vger.kernel.org,
Netfilter Development Mailinglist
<netfilter-devel@vger.kernel.org>
Subject: Re: hashsize in nf_conntrack_ipv4
Date: Wed, 19 Dec 2007 11:17:32 +0100 [thread overview]
Message-ID: <4768EFBC.8070300@trash.net> (raw)
In-Reply-To: <BAY122-W8237C00B08D4A997705B6BE5C0@phx.gbl>
[-- Attachment #1: Type: text/plain, Size: 727 bytes --]
李伟华 wrote:
>
> kernel version 2.6.23.9
>
> when i load nf_conntrack_ipv4 with cmdline "modprobe ip_conntrack hashsize=10000" ,
> i got a err msg
> "FATAL: Error inserting nf_conntrack_ipv4 (/lib/modules/2.6.23.9/kernel/net/ipv4/netfilter/nf_conntrack_ipv4.ko):
> Unknown symbol in module, or unknown parameter (see dmesg)" ,
> and endline in dmesg output
> "nf_conntrack_ipv4: Unknown parameter `hashsize' "
>
> so,how can i set the buckets number when i loading ip_conntrack ?
Its a parameter of nf_conntrack now. But this is actually a bug since
we wanted to stay compatible from a user perspective. Could you
try if this patch makes it work with modprobe ip_conntrack again?
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1984 bytes --]
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 90fb66d..4ac5ab1 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -249,6 +249,7 @@ static inline int nf_ct_is_untracked(const struct sk_buff *skb)
return (skb->nfct == &nf_conntrack_untracked.ct_general);
}
+extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
extern unsigned int nf_conntrack_htable_size;
extern int nf_conntrack_checksum;
extern atomic_t nf_conntrack_count;
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 831e9b2..910dae7 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -419,6 +419,9 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = {
.me = THIS_MODULE,
};
+module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint,
+ &nf_conntrack_htable_size, 0600);
+
MODULE_ALIAS("nf_conntrack-" __stringify(AF_INET));
MODULE_ALIAS("ip_conntrack");
MODULE_LICENSE("GPL");
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 000c2fb..91f8dbd 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1016,7 +1016,7 @@ struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced)
}
EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable);
-int set_hashsize(const char *val, struct kernel_param *kp)
+int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
{
int i, bucket, hashsize, vmalloced;
int old_vmalloced, old_size;
@@ -1064,7 +1064,7 @@ int set_hashsize(const char *val, struct kernel_param *kp)
return 0;
}
-module_param_call(hashsize, set_hashsize, param_get_uint,
+module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint,
&nf_conntrack_htable_size, 0600);
int __init nf_conntrack_init(void)
parent reply other threads:[~2007-12-19 10:17 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <BAY122-W8237C00B08D4A997705B6BE5C0@phx.gbl>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4768EFBC.8070300@trash.net \
--to=kaber@trash.net \
--cc=liweihuahot@hotmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).