Re: Different tcp connect behaviour in 2.2.5 and 2.2.12

From: Ed Carp (erc@pobox.com)
Date: Fri May 12 2000 - 16:03:06 EST


Meelis Roos (mroos@linux.ee) writes:

> FR> I developed a client/server app that worked fine with kernel 2.2.5 but
> FR> behaves not the way I want under kernel 2.2.12.
> FR> My client connects to my server on port 5001 and the client does a local
> FR> bind on port 6002 for that socket first, i.p. addresses are all localhost.
>
> This is normal behaviour. You always want to connect from the same port.
> In Internet this is not a good thing because there may be some old
> packets around for up to 255 seconds. If you establish a new connection
> on exactly same IP-s and ports then the old packet may finally arrive
> and confuse things.

Hmmm. That shouldn't be possible, since the socket should be in TIME_WAIT,
and therefore the connect() call will fail with ECONNREFUSED (on the client
side). The server should fail when it does the bind() with whatever the
errno is for "address already in use" until the socket goes from TIME_WAIT
to CLOSE.

Or that's my understanding from reading the UNIX Socket FAQ, anyway.

--
Ed Carp, N7EKG  	erc@pobox.com		940/367-2744 cell phone
			http://www.pobox.com/~erc

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:21 EST