lkml.org 
[lkml]   [1996]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectIP Masquerading fix for 2.1.14
Date


Between me noticing that UDP worked and TCP didn't, and someone
pointing out to me that IP masquerading worked in 2.1.6 (Thanks
Dennis!) clued me in enough to find the problem. Here's a patch
against the 2.1.14 ip_masq.c fixes the problem:

--- linux-2.1.14/net/ipv4/ip_masq.c Wed Dec 11 21:52:38 1996
+++ linux/net/ipv4/ip_masq.c Wed Dec 11 19:45:07 1996
@@ -566,8 +566,10 @@
else timeout = ip_masq_expire->tcp_timeout;

skb->csum = csum_partial((void *)(th + 1), size - sizeof(*th), 0);
- tcp_v4_check(th, size, iph->saddr, iph->daddr,
- skb->csum);
+ th->check = 0;
+ th->check = tcp_v4_check(th, size, iph->saddr, iph->daddr,
+ csum_partial ((char *)th, sizeof(*th),
+ skb->csum));
}
ip_masq_set_expire(ms, timeout);
ip_send_check(iph);
@@ -899,9 +901,11 @@
len - sizeof(struct tcphdr), 0);
th = (struct tcphdr *) portptr;
th->check = 0;
-
- tcp_v4_check(th, len, iph->saddr, iph->daddr,
- skb->csum);
+ th->check = tcp_v4_check(th, len, iph->saddr,
+ iph->daddr,
+ csum_partial((char *)th,
+ sizeof(*th),
+ skb->csum));

/* Check if TCP FIN or RST */


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.021 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site