|
@@ -40,7 +40,7 @@ MODULE_PARM_DESC(master_timeout, "timeout for the master connection");
|
|
|
static char *conns[] = { "DATA ", "MESG ", "INDEX " };
|
|
|
|
|
|
/* This is slow, but it's simple. --RR */
|
|
|
-static char amanda_buffer[65536];
|
|
|
+static char *amanda_buffer;
|
|
|
static DEFINE_SPINLOCK(amanda_buffer_lock);
|
|
|
|
|
|
unsigned int (*ip_nat_amanda_hook)(struct sk_buff **pskb,
|
|
@@ -153,11 +153,25 @@ static struct ip_conntrack_helper amanda_helper = {
|
|
|
static void __exit fini(void)
|
|
|
{
|
|
|
ip_conntrack_helper_unregister(&amanda_helper);
|
|
|
+ kfree(amanda_buffer);
|
|
|
}
|
|
|
|
|
|
static int __init init(void)
|
|
|
{
|
|
|
- return ip_conntrack_helper_register(&amanda_helper);
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ amanda_buffer = kmalloc(65536, GFP_KERNEL);
|
|
|
+ if (!amanda_buffer)
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
+ ret = ip_conntrack_helper_register(&amanda_helper);
|
|
|
+ if (ret < 0) {
|
|
|
+ kfree(amanda_buffer);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
module_init(init);
|