]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[netdevice] Reset network device index when last device is unregistered
authorMichael Brown <mcb30@ipxe.org>
Mon, 14 Jul 2014 11:14:18 +0000 (12:14 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 14 Jul 2014 11:17:19 +0000 (12:17 +0100)
commitc4af97727131a6675c67de4f2fc3f72e4dd4fc35
tree25d937f57b3b4c143243d16af837a3f244005acb
parent50e48d5b1927206825235212657c48ec77a5e59f
[netdevice] Reset network device index when last device is unregistered

When functioning as an EFI driver, drivers can be disconnected and
reconnected multiple times (e.g. via the EFI shell "connect" command,
or by running an executable such as ipxe.efi which will temporarily
disconnect existing drivers).

Minimise surprise by resetting the network device index to zero
whenever the last device is unregistered.  This is not foolproof, but
it does handle the common case of having all devices unregistered and
then reregistered in the original order.

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