Subject: (from Linux net-dev) dynamic IP support for 2.4.0 (SIOCKILLADDR)
To: None <tech-net@netbsd.org>
From: Michael Richardson <mcr@sandelman.ottawa.on.ca>
List: tech-net
Date: 01/28/2001 14:05:32
  I know that we've talking about general event notification for awhile.

Delivery-Date: Sat Jan 27 17:57:32 2001
>From mcr  Sat Jan 27 17:57:32 2001
To: <linux-kernel@vger.kernel.org>
Cc: <netdev@oss.sgi.com>, <paulus@linuxcare.com>, <linux-ppp@vger.kernel.org>,
        <linux-net@vger.kernel.org>
Subject: [PATCH] dynamic IP support for 2.4.0 (SIOCKILLADDR)
From: "John Fremlin" <vii@altern.org>
Date:   27 Jan 2001 22:54:51 +0000
Message-ID: <m2d7d838sj.fsf@boreas.yi.org.>
Lines:  38
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Sender: owner-netdev@oss.sgi.com


--=-=-=

When the IP address of an interface changes, TCP connections with the
old source address are useless. Applications are not notified of this
and time out ordinarily, just as if nothing had happened. This is
behaviour isn't very helpful when you have a dynamic IP and know
you're probably not going to get the old one back. In that case, you
want processes to get errors when they try to use one of the dead
connections, so they can handle the disconnect more cleanly. Otherwise
fetchmail, etc. can just hang waiting for ages. Andi Kleen implemented
this functionality with a per interface flag in 2.2. See
ftp.suse.com:/pub/people/ak/v2.2/iff-dynamic*.

The following patch against 2.4.0 does it a different way. It
introduces a new ioctl, called SIOCKILLADDR. When this ioctl is
called, it makes all IPv4 sockets with the specified source address
return -ENETRESET when they are used.

Is this the right error number? I wasn't quite sure where the ioctl
should go to be in keeping with convention - I bunged it in
devinet_ioctl.

I patched userspace ppp-2.4.0 to use this functionality. It would be
better if SIOCKILLADDR were not used until we are sure that the new IP
is in fact different from the old one, but pppd in demand mode would
not notice that there were extant connections and so would not bring
up the link - so the problem would not be alleviated. Therefore
SIOCKILLADDR is used on disconnect. The functionality is activated
with the killoldaddr option. I would be happy to document it in the
manpage if it were accepted. Further the build process is cleaned up
slightly, as in the patch I sent on or around 8 October 2000.


==== patches removed ====