]> git.hungrycats.org Git - linux/commit
[NET]: Fix sysctl breakage during network device renaming.
authorDan Aloni <da-x@gmx.net>
Mon, 20 Oct 2003 15:59:22 +0000 (08:59 -0700)
committerDavid S. Miller <davem@nuts.ninka.net>
Mon, 20 Oct 2003 15:59:22 +0000 (08:59 -0700)
commitf2bf7504d68104575b243aa2e1ba2f819d61ef53
tree08f0a2c88e9e8c77e11675b60bf72e20ad0516d8
parent0b8c03e488d0a5ff989f8d9f757e87cb0f1fd85b
[NET]: Fix sysctl breakage during network device renaming.

Sysctl assumes its ctl_table.procname field is const, but the
networking points ctl_table.procname to dev->name. When renaming
a network device using SIOCSIFNAME, dev->name is modified and
sysctl's assumption breaks, causing this behaviour, at least:

  1. sysctl wouldn't be able to remove the proc entry when the
     device requests to be unregistered, because it would be
     using the new name instead of the old one.
  2. proc entries for devices remain with the old name after
     rename.

This change includes allocating the current device name to a
new copy upon registering with sysctl, plus re-registering with
sysctl when the device is renamed.

This only fixes IPv4, IPv6, and net/core/neightbour.c.
Fixes for ax25 and decnet are also planned.
include/linux/netdevice.h
net/core/neighbour.c
net/core/sysctl_net_core.c
net/ipv4/devinet.c
net/ipv6/addrconf.c