wireless: fix premature removal of hotplug devices due to down state
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Nov 2023 14:34:23 +0000 (15:34 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 10 Nov 2023 14:36:27 +0000 (15:36 +0100)
commit35facc8306f590a7330789ab6d5785c0d43073ef
tree97cb1d059b36b0bc194be618be1d803b3d8fa1d0
parentbb28f6a291d9dfd6b8d6e28be94ef1de3e625500
wireless: fix premature removal of hotplug devices due to down state

When a device is added that isn't up, status toggles can sometimes lead to a
DEV_EVENT_REMOVE event, which causes the device to be removed from an interface
or a bridge.
Fix this by toggling the dev->disabled status instead based on IFF_UP, and
adding a check to bridge/interface code to only permanently remove devices that
are actually gone.

Fixes: 516ab774cc16 ("system-linux: fix race condition on bringing up wireless devices")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
bonding.c
bridge.c
device.c
interface.c
system-linux.c