patch-1.3.86 linux/net/ipv4/ip_fw.c

Next file: linux/net/ipv4/ip_input.c
Previous file: linux/net/ipv4/icmp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.85/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
@@ -899,6 +899,44 @@
 			return(ETIMEDOUT);
 	}
 
+	if ( cmd == IP_FW_MASQ_TIMEOUTS )
+	{
+#ifdef CONFIG_IP_MASQUERADE
+		struct ip_fw_masq *masq;
+
+		if ( len != sizeof(struct ip_fw_masq) )
+		{
+#ifdef DEBUG_CONFIG_IP_FIREWALL
+			printk("ip_fw_ctl (masq): length %d, expected %d\n",
+				len, sizeof(struct ip_fw_masq));
+
+#endif
+			return( EINVAL );
+		}
+
+		masq = (struct ip_fw_masq *) m;
+
+		if (masq->tcp_timeout)
+		{
+			ip_masq_expire->tcp_timeout = masq->tcp_timeout;
+		}
+
+		if (masq->tcp_fin_timeout)
+		{
+			ip_masq_expire->tcp_fin_timeout = masq->tcp_fin_timeout;
+		}
+
+		if (masq->udp_timeout)
+		{
+			ip_masq_expire->udp_timeout = masq->udp_timeout;
+		}
+
+		return 0;
+#else
+		return( EINVAL );
+#endif
+	}
+
 /*
  *	Here we really working hard-adding new elements
  *	to blocking/forwarding chains or deleting 'em

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this