]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[netdevice] Stop link block timer when device is closed
authorMichael Brown <mcb30@ipxe.org>
Wed, 5 Jul 2023 13:30:54 +0000 (14:30 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 5 Jul 2023 13:30:54 +0000 (14:30 +0100)
commit6701d91c5033a3804a3bb5d49a8f9f2212b901b4
tree0a5e950f56f174bf4f27d0d06a5b2df2e6e8f9c6
parentb5b60ea33dc48a297515f95ac19cca20bb39edd1
[netdevice] Stop link block timer when device is closed

A running link block timer holds a reference to the network device and
will prevent it from being freed until the timer expires.  It is
impossible for free_netdev() to be called while the timer is still
running: the call to stop_timer() therein is therefore a no-op.

Stop the link block timer when the device is closed, to allow a
link-blocked device to be freed immediately upon unregistration of the
device.  (Since link block state is updated in response to received
packets, the state is effectively undefined for a closed device: there
is therefore no reason to leave the timer running.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/netdevice.c