]> git.baikalelectronics.ru Git - kernel.git/commit
bridge: update sysfs link names if port device names have changed
authorSimon Arlott <simon@fire.lp0.eu>
Mon, 10 May 2010 09:31:11 +0000 (09:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 May 2010 06:10:15 +0000 (23:10 -0700)
commit6e814e441bc82683771236b80d1fb2ec1a0a3cfb
tree892d0fbc2ecae39f2e5c4a7b711cbb988c8dc3f1
parent8209d1e4d53fad66fbc0b9b07e2c64ca643489a9
bridge: update sysfs link names if port device names have changed

Links for each port are created in sysfs using the device
name, but this could be changed after being added to the
bridge.

As well as being unable to remove interfaces after this
occurs (because userspace tools don't recognise the new
name, and the kernel won't recognise the old name), adding
another interface with the old name to the bridge will
cause an error trying to create the sysfs link.

This fixes the problem by listening for NETDEV_CHANGENAME
notifications and renaming the link.

https://bugzilla.kernel.org/show_bug.cgi?id=12743

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
fs/sysfs/symlink.c
net/bridge/br_if.c
net/bridge/br_notify.c
net/bridge/br_private.h
net/bridge/br_sysfs_if.c