Re: Dynamic IP hack (PR#294)

Andi Kleen (ak@muc.de)
Sun, 18 Oct 1998 20:56:29 +0200


On Sun, Oct 18, 1998 at 08:08:44PM +0200, kuznet@ms2.inr.ac.ru wrote:
> Hello!
>
> > I think that is the wrong way.
>
> Andi, look at this piece of code (especially, with patch under discussion)
> and you will understand that it must be either deleted at all,
> or (taking into account its importance) reliably ifdefed.
>
> > the others don't. So IMHO the right thing(tm) is to check if the socket
> > was bound explicitely and if yes don't do the rewrite. There currently
> > seems to be no way to do it so that needs a new per-socket flag (that
> > is cleaned on shutdown of course)
>
> Yes. If it were programmed accurately I had no reasons to object.
>
> About established state: no IFF_DYNAMIC will help you: established
> is established.

IFF_DYNAMIC doesn't try to change the addresses, it simply knows that the
connection is lost because the user gurantees that the IP address is gone
and cannot be recovered. Because that fact is known for sure it simply
calls tcp_reset on the connection to kill it. The 2.0 RST
hack used an indirect scheme, it will send out an packet with wrong
source and assumes the other end will RST it.

Now for SYN_SENT sockets I think it is worth to keep the ip_dynaddr hack,
assuming it can be proved that the application didn't explicitely call
bind() first - if it didn't the kernel selected the source address on
its own via inet_autobind anyways, and it doesn't harm anybody when its
decision is revised a little bit later, because noone else knows about its
choices yet.

So an sk->userbind flag is the way to go I think.

-Andi

-
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/