Transparent proxy fix for 2.0.31

saw@msu.ru
Tue, 5 Aug 1997 22:47:46 +0400 (MSD)


In the case transparent proxy problem fix isn't included yet here is a patch.

The problem is that kernel forget to redirect packets to different port.
The patch also fix kernel messages being output too fast.

Regards,
Andrey V.
Savochkin

--- linux-2.0.30-ee/net/ipv4/tcp_input.c Tue Apr 15 19:07:37 1997
+++ linux-2.0.30/net/ipv4/tcp_input.c Tue Jun 10 20:44:49 1997
@@ -588,7 +588,7 @@
if (!tcp_clearance(saddr)) {
#endif
/* Only let this warning get printed once a minute. */
- if (jiffies - warning_time > HZ) {
+ if (jiffies - warning_time > HZ*60) {
warning_time = jiffies;
printk(KERN_INFO "Warning: possible SYN flooding. Sending cookies.\n");
}
@@ -2262,6 +2262,12 @@
#ifdef CONFIG_SYN_COOKIES
retry_search:
#endif
+#ifdef CONFIG_IP_TRANSPARENT_PROXY
+ if (skb->redirport)
+ sk = tcp_v4_proxy_lookup(th->dest, saddr, th->source, daddr,
+ dev->pa_addr, skb->redirport);
+ else
+#endif
sk = __tcp_v4_lookup(th, saddr, th->source, daddr, th->dest);
if (!sk)
goto no_tcp_socket;