ソースを参照

[xfer] Send intf_close() if redirection fails

A redirection failure is fatal, but provides no opportunity for the
caller of xfer_[v]redirect() to report the failure since the interface
will already have been disconnected.  Fix by sending intf_close() from
within the default xfer_vredirect() handler.

Debugged-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8年前
コミット
5e2a7481ad
1個のファイルの変更5行の追加0行の削除
  1. 5
    0
      src/core/xfer.c

+ 5
- 0
src/core/xfer.c ファイルの表示

@@ -81,12 +81,17 @@ int xfer_vredirect ( struct interface *intf, int type, va_list args ) {
81 81
 		 * xfer_vreopen(), we create a temporary interface in
82 82
 		 * order to be able to send xfer_window_changed() to
83 83
 		 * the parent.
84
+		 *
85
+		 * If redirection fails, then send intf_close() to the
86
+		 * parent interface.
84 87
 		 */
85 88
 		intf_plug ( &tmp, dest );
86 89
 		rc = xfer_vreopen ( dest, type, args );
87 90
 		if ( rc == 0 ) {
88 91
 			xfer_window_changed ( dest );
89 92
 			xfer_window_changed ( &tmp );
93
+		} else {
94
+			intf_close ( &tmp, rc );
90 95
 		}
91 96
 		intf_unplug ( &tmp );
92 97
 	}

読み込み中…
キャンセル
保存