Re: 2.2.2-ac7 TCP ignores ICMP host unreachable ??

kuznet@ms2.inr.ac.ru
Mon, 8 Mar 1999 22:44:41 +0300 (MSK)


Hello!

> So there is a *different* behaviour between 2.0.36 and 2.2.2-ac7.
> (another option would be that the ICMPs returned on the SYN packets from
> 2.2.2-ac7 (with all those TCP options) get garbled in a different way
> than the simpler 2.0.36 SYN packets ...)

Yes, I see the reason. Router is not broken, it is my routers that
are too good to see this bug. 8) Patch is appended.

Alexey Kuznetsov

--- linux/net/ipv4/tcp_ipv4.c.orig Mon Mar 8 21:10:35 1999
+++ linux/net/ipv4/tcp_ipv4.c Mon Mar 8 21:16:10 1999
@@ -789,6 +789,11 @@
struct tcp_opt *tp;
int type = skb->h.icmph->type;
int code = skb->h.icmph->code;
+#if ICMP_MIN_LENGTH < 14
+ int no_flags = 0;
+#else
+#define no_flags 0
+#endif
struct sock *sk;
__u32 seq;
int err;
@@ -797,6 +802,10 @@
icmp_statistics.IcmpInErrors++;
return;
}
+#if ICMP_MIN_LENGTH < 14
+ if (len < (iph->ihl << 2) + 14)
+ no_flags = 1;
+#endif

th = (struct tcphdr*)(dp+(iph->ihl<<2));

@@ -863,7 +872,7 @@
* ACK should set the opening flag, but that is too
* complicated right now.
*/
- if (!th->syn && !th->ack)
+ if (!no_flags && !th->syn && !th->ack)
return;

req = tcp_v4_search_req(tp, iph, th, &prev);
@@ -898,7 +907,7 @@
break;
case TCP_SYN_SENT:
case TCP_SYN_RECV: /* Cannot happen */
- if (!th->syn)
+ if (!no_flags && !th->syn)
return;
tcp_statistics.TcpAttemptFails++;
sk->err = err;
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu