Re: Dynamic IP hack

Andi Kleen (ak@muc.de)
Sun, 18 Oct 1998 11:57:45 +0200


> +If you enable the RST-provoking mode, then the source address will
> +be changed, even if the socket is established. This means we send
> +an incorrect packet out, which causes the remote host to kill our
> +socket. This is the desired behaviour, because such a socket is
> +doomed anyway, and the earlier it dies, the better. This prevents
> +the dial-on-demand connection from being kept up by a dead connection,
> +and tells the application that the connection was lost.
> +
> +With the RST-provoking mode enabled it happens packets with the address
> +of another interface as source are rewritten and get a new source address
> +this way. If you have asymetric routing and the other interfaces have
> +static addresses enabling the work-around might[**] help you.

I have a better solution for this problem implemented on 2.1. I added a new
IFF_DYNAMIC interface flag that is inherited by all IP addresses set on the
interface, and when they finally disappear (not exist on any other interface)
fib sends out a NETDEV_REBOOT notifier on the inetaddr_chain. TCP simply
hooks into that chain and when it receives NETDEV_REBOOT calls tcp_reset
on all sockets with that source address set.

Advantage over your patch:
- Cleaner
- Doesn't send out bogus packets
- Could be used in future by other protocols and even user space (over
rtnetlink) too.

I didn't submit it because of the code freeze, but before your patch would
be added I think my patch would fit better and is more maintainable.
Only caveat is that it needs another patch to remove IFF_NODYNARP, otherwise
there are no interface flags bits left (iffr_flags is a short).

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