Re: 1.3.63 & no SYN ?

Linus Torvalds (torvalds@cs.helsinki.fi)
Thu, 15 Feb 1996 13:58:07 +0200 (EET)


>
> ignore my ignorace, I don't know the correct name:
>
> when a tcp/ip stack receives a connection request, which is not assigned
> (no server listening on it), it sends a SYN (correct??) so that the other
> host will get a "connection refused".

It's a RST, for "ReSeT", but yes, that's what should happen.

> as of at least 1.3.63, this mechanism seems not to be working anymore,
> e.g. "telnet localhost 4444" (4444=not bound) ends with a timeout.
> note that this also happens with non-local (not loopback) connections.

Actually, 1.3.63 _does_ send the RST, but sadly it mangles the packet, ugh. It
seems that it doesn't correctly set the "doff" field in the TCP header of the
outgoing packet, so please just add

t1->doff = sizeof(*t1)/4;

to the approprate place (along with the other t1 initializations) in
tcp_send_reset() in net/ipv4/tcp_output.c. That should hopefully fix it
(untested, but it looks like this could be the problem).

I think Alan tried to optimize things, and assumed that "doff" for the outgoing
packet would be the same as doff for the incoming one, which isn't true if
there are TCP options in the incoming packet (as is the case with connection
requests - the SYN packet contains the initial mss). At least this is my
current guess.

Linus