mirror of
https://github.com/ipxe/ipxe
synced 2026-02-28 03:11:18 +03:00
[pxe] Reopen network device if NBP exits
Attempt to restore the network device to the state it was in prior to calling the NBP. This simplifies the task of taking follow-up action in an iPXE script. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -65,6 +65,7 @@ static int pxe_exec ( struct image *image ) {
|
|||||||
image );
|
image );
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
netdev_get ( netdev );
|
||||||
|
|
||||||
/* Activate PXE */
|
/* Activate PXE */
|
||||||
pxe_activate ( netdev );
|
pxe_activate ( netdev );
|
||||||
@@ -81,6 +82,12 @@ static int pxe_exec ( struct image *image ) {
|
|||||||
/* Deactivate PXE */
|
/* Deactivate PXE */
|
||||||
pxe_deactivate();
|
pxe_deactivate();
|
||||||
|
|
||||||
|
/* Try to reopen network device. Ignore errors, since the NBP
|
||||||
|
* may have called PXENV_STOP_UNDI.
|
||||||
|
*/
|
||||||
|
netdev_open ( netdev );
|
||||||
|
netdev_put ( netdev );
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user