netdev
[Top] [All Lists]

[PATCH] dynamic IP support for 2.4.0 (SIOCKILLADDR)

To: <linux-kernel@xxxxxxxxxxxxxxx>
Subject: [PATCH] dynamic IP support for 2.4.0 (SIOCKILLADDR)
From: "John Fremlin" <vii@xxxxxxxxxx>
Date: 27 Jan 2001 22:54:51 +0000
Cc: <netdev@xxxxxxxxxxx>, <paulus@xxxxxxxxxxxxx>, <linux-ppp@xxxxxxxxxxxxxxx>, <linux-net@xxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
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.

Attachment: linux-2.4.0-dynip-3.patch
Description: Text Data

Attachment: ppp-2.4.0-killaddr.patch
Description: Text Data

-- 

        http://www.penguinpowered.com/~vii
<Prev in Thread] Current Thread [Next in Thread>