Amanda conntrack/nat module update
PATCH 1/1 Amanda conntrack/nat module update
Hello Harald and friends,
Please find attached an update patch to patch-o-matic for my Amanda protocol conntrack/nat helper. This patch corrects a minor error in the Config.in indentation as well as, and more importantly, lengthens the timeout for the master Amanda connection from the default UDP stream timeout (normally 180 seconds) to 300 seconds.
This is required, because the Amanda server can tell the client to go off and do some work (i.e. estimate the size of backups at various incremental levels) and while the client is doing the work, no communication will occur. It is not uncommon for a client to take in excess of 180 seconds to do the estimates. Indeed, on my network here, the value of 300 seconds is sufficient while 180 is not.
Additionally, this value can be tuned at module load time with a module parameter, "master_timeout".
I would be most appreciative if you could apply this patch to patch-o-matic at your earliest convenience.
In case anyone is interested, this patch implements a solution to my question in this (incorrectly subjected) mailing list posting:
http://lists.netfilter.org/pipermail/netfilter-devel/2002-October/009676.html
Thanx,
b.
Signature · 1 line
Brian J. Murrell
Index: extra/amanda-conntrack-nat.patch
===================================================================
RCS file: /cvspublic/netfilter/patch-o-matic/extra/amanda-conntrack-nat.patch,v retrieving revision 1.1
amanda-conntrack-nat.patch +18 -4
@@ -34,10 +34,10 @@ diff -uNr linux-2.4.18-6mdk-pom-clean/net/ipv4/netfilter/ip_conntrack_amanda.c linux-2.4.18-6mdkuml-48um-pom/net/ipv4/netfilter/ip_conntrack_amanda.c --- linux-2.4.18-6mdk-pom-clean/net/ipv4/netfilter/ip_conntrack_amanda.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.18-6mdkuml-48um-pom/net/ipv4/netfilter/ip_conntrack_amanda.c 2002-08-16 04:24:25.000000000 -0400 -@@ -0,0 +1,219 @@ -+/* Amanda extension for IP connection tracking, Version 0.1 +@@ -0,0 +1,233 @@ ++/* Amanda extension for IP connection tracking, Version 0.2 + * (C) 2002 by Brian J. Murrell <[email protected]> -+ * based on HW's ip_conntrack_irc.c as well as other modules ++ * based on HW's ip_conntrack_irc.c as well as other modules + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License
@@ -45,7 +45,13 @@ + * 2 of the License, or (at your option) any later version. + * + * Module load syntax: -+ * insmod ip_conntrack_amanda.o ++ * insmod ip_conntrack_amanda.o [master_timeout=n] ++ * ++ * Where master_timeout is the timeout (in seconds) of the master ++ * connection (port 10080). This defaults to 5 minutes but if ++ * your clients take longer than 5 minutes to do their work ++ * before getting back to the Amanda server, you can increase ++ * this value. + * + */ +
@@ -59,9 +65,13 @@ +#include <linux/netfilter_ipv4/ip_conntrack_helper.h> +#include <linux/netfilter_ipv4/ip_conntrack_amanda.h> + ++static unsigned int master_timeout = 300; ++ +MODULE_AUTHOR("Brian J. Murrell <[email protected]>"); +MODULE_DESCRIPTION("Amanda connection tracking module"); +MODULE_LICENSE("GPL"); ++MODULE_PARM(master_timeout, "i"); ++MODULE_PARM_DESC(master_timeout, "timeout for the master connection"); + +DECLARE_LOCK(ip_amanda_lock); +struct module *ip_conntrack_amanda = THIS_MODULE;
@@ -97,6 +107,10 @@ + /* Can't track connections formed before we registered */ + if (!info) + return NF_ACCEPT; ++ ++ /* increase the UDP timeout of the master connection as replies from ++ * Amanda clients to the server can be quite delayed */ ++ ip_ct_refresh(ct, master_timeout * HZ); + + /* If packet is coming from Amanda server */ + if (dir == IP_CT_DIR_ORIGINAL)
Index: extra/amanda-conntrack-nat.patch.config.in-2
===================================================================
RCS file: /cvspublic/netfilter/patch-o-matic/extra/amanda-conntrack-nat.patch.config.in-2,v retrieving revision 1.1
amanda-conntrack-nat.patch.config.in-2 +1 -1
@@ -1,6 +1,6 @@ dep_tristate ' REDIRECT target support' CONFIG_IP_NF_TARGET_REDIRECT $CONFIG_IP_NF_NAT if [ "$CONFIG_IP_NF_AMANDA" = "m" ]; then - define_tristate CONFIG_IP_NF_NAT_AMANDA m + define_tristate CONFIG_IP_NF_NAT_AMANDA m else if [ "$CONFIG_IP_NF_AMANDA" = "y" ]; then define_tristate CONFIG_IP_NF_NAT_AMANDA $CONFIG_IP_NF_NAT
Martin Josefsson
AppliedQuoted 10 lines · On Sat, 2002-11-02 at 00:23, [email protected] wrote:
Hello Harald and friends,
Please find attached an update patch to patch-o-matic for my Amanda protocol conntrack/nat helper. This patch corrects a minor error in the Config.in indentation as well as, and more importantly, lengthens the timeout for the master Amanda connection from the default UDP stream timeout (normally 180 seconds) to 300 seconds.
I would be most appreciative if you could apply this patch to patch-o-matic at your earliest convenience.
Applied,
Thanks
Signature · 4 lines
/Martin Never argue with an idiot. They drag you down to their level, then beat you with experience.
Quoted 7 lines · On Fri, Nov 01, 2002 at 06:23:37PM -0500, [email protected] wrote:
Hello Harald and friends,
Please find attached an update patch to patch-o-matic for my Amanda protocol conntrack/nat helper. This patch corrects a minor error in the Config.in indentation as well as, and more importantly, lengthens the timeout for the master Amanda connection from the default UDP stream timeout (normally 180 seconds) to 300 seconds.
thanks, patch applied.
Quoted 2 lines
Thanx,
b.
Signature · 5 lines
Live long and prosper - Harald Welte / [email protected] http://www.gnumonks.org/ ============================================================================ "If this were a dictatorship, it'd be a heck of a lot easier, just so long as I'm the dictator." -- George W. Bush Dec 18, 2000
Quoted 7 lines · Martin Josefsson
Quoted 6 lines · On Sat, 2002-11-02 at 00:23, [email protected] wrote:
Please find attached an update patch to patch-o-matic for my Amanda protocol conntrack/nat helper. This patch corrects a minor error in the Config.in indentation as well as, and more importantly, lengthens the timeout for the master Amanda connection from the default UDP stream timeout (normally 180 seconds) to 300 seconds.
So, I am assuming that the theory and my implementation of a conntracker extending the timeout for it's own master connection beyond the default is/was correct?
Quoted 1 line
Applied,
Thanx!!
b.
Signature · 1 line
Brian J. Murrell
Quoted 9 lines · Martin Josefsson
Quoted 7 lines · On Sat, 2002-11-02 at 00:23, [email protected] wrote:
Hello Harald and friends,
Please find attached an update patch to patch-o-matic for my Amanda protocol conntrack/nat helper. This patch corrects a minor error in the Config.in indentation as well as, and more importantly, lengthens the timeout for the master Amanda connection from the default UDP stream timeout (normally 180 seconds) to 300 seconds.
Quoted 4 lines
Quoted 2 lines
I would be most appreciative if you could apply this patch to patch-o-matic at your earliest convenience.
Applied,
thanks, I tried to apply it 30mins later and had to discover that my CVS was not up-to-date ;) Sometimes I seem to forget that there is somebody else taking care of patch-o-matic now. Thanks again.
Quoted 1 line
/Martin
Signature · 5 lines
Live long and prosper - Harald Welte / [email protected] http://www.gnumonks.org/ ============================================================================ "If this were a dictatorship, it'd be a heck of a lot easier, just so long as I'm the dictator." -- George W. Bush Dec 18, 2000