summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjorn Mork <bjorn@mork.no>2008-02-26 18:17:53 -0800
committerDavid S. Miller <davem@davemloft.net>2008-02-26 18:42:41 -0800
commit148f97292e8fa2c35fcef60a7725cf1b073d6818 (patch)
tree8f612110246bf58ffa3b6b077060ff786059a8e4
parentf1243c2db6e3b8e5a602b1be2d256b582fc78ce4 (diff)
[IPV4]: Reset scope when changing address
This bug did bite at least one user, who did have to resort to rebooting the system after an "ifconfig eth0 127.0.0.1" typo. Deleting the address and adding a new is a less intrusive workaround. But I still beleive this is a bug that should be fixed. Some way or another. Another possibility would be to remove the scope mangling based on address. This will always be incomplete (are 127/8 the only address space with host scope requirements?) We set the scope to RT_SCOPE_HOST if an IPv4 interface is configured with a loopback address (127/8). The scope is never reset, and will remain set to RT_SCOPE_HOST after changing the address. This patch resets the scope if the address is changed again, to restore normal functionality. Signed-off-by: Bjorn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/devinet.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index f282b26f63e..87490f7bb0f 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -752,6 +752,7 @@ int devinet_ioctl(unsigned int cmd, void __user *arg)
inet_del_ifa(in_dev, ifap, 0);
ifa->ifa_broadcast = 0;
ifa->ifa_anycast = 0;
+ ifa->ifa_scope = 0;
}
ifa->ifa_address = ifa->ifa_local = sin->sin_addr.s_addr;