瀏覽代碼

[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>
tags/v1.20.1
Michael Brown 12 年之前
父節點
當前提交
88016deccf
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7
    0
      src/arch/i386/image/pxe_image.c

+ 7
- 0
src/arch/i386/image/pxe_image.c 查看文件

@@ -65,6 +65,7 @@ static int pxe_exec ( struct image *image ) {
65 65
 		       image );
66 66
 		return -ENODEV;
67 67
 	}
68
+	netdev_get ( netdev );
68 69
 
69 70
 	/* Activate PXE */
70 71
 	pxe_activate ( netdev );
@@ -81,6 +82,12 @@ static int pxe_exec ( struct image *image ) {
81 82
 	/* Deactivate PXE */
82 83
 	pxe_deactivate();
83 84
 
85
+	/* Try to reopen network device.  Ignore errors, since the NBP
86
+	 * may have called PXENV_STOP_UNDI.
87
+	 */
88
+	netdev_open ( netdev );
89
+	netdev_put ( netdev );
90
+
84 91
 	return rc;
85 92
 }
86 93
 

Loading…
取消
儲存