udev: attempt device rename even if interface is up
authorNick Rosbrook <nick.rosbrook@canonical.com>
Fri, 2 Dec 2022 20:35:25 +0000 (15:35 -0500)
committerNick Rosbrook <nick.rosbrook@canonical.com>
Thu, 15 Dec 2022 14:35:26 +0000 (09:35 -0500)
commit53584e7b61373c26635b906eb64e98fbd3fd3ba4
tree9386aac24c153f794d432e9e625cde1306e97b43
parent4d600667f8af2985850b03a46357e068d3fb8570
udev: attempt device rename even if interface is up

Currently rename_netif() will not attempt to rename a device if it is
already up, because the kernel will return -EBUSY unless live renaming
is allowed on the device. This restriction will be removed in a future
kernel version [1].

To cover both cases, always attempt to rename the interface and return 0
if we get -EBUSY.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=bd039b5ea2a9
src/udev/udev-event.c