summaryrefslogtreecommitdiffstats
path: root/src/core/xfer.c
diff options
context:
space:
mode:
authorMichael Brown2016-07-04 17:10:45 +0200
committerMichael Brown2016-07-04 17:14:46 +0200
commit5e2a7481ada168ab8b5f58bbe099ef51b7b09098 (patch)
tree166122a42d0367be138a7ab6d74d865320ec63b4 /src/core/xfer.c
parent[dhcp] Automatically generate vendor class identifier string (diff)
downloadipxe-5e2a7481ada168ab8b5f58bbe099ef51b7b09098.tar.gz
ipxe-5e2a7481ada168ab8b5f58bbe099ef51b7b09098.tar.xz
ipxe-5e2a7481ada168ab8b5f58bbe099ef51b7b09098.zip
[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>
Diffstat (limited to 'src/core/xfer.c')
-rw-r--r--src/core/xfer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/xfer.c b/src/core/xfer.c
index 112fee1b..3a2f174d 100644
--- a/src/core/xfer.c
+++ b/src/core/xfer.c
@@ -81,12 +81,17 @@ int xfer_vredirect ( struct interface *intf, int type, va_list args ) {
* xfer_vreopen(), we create a temporary interface in
* order to be able to send xfer_window_changed() to
* the parent.
+ *
+ * If redirection fails, then send intf_close() to the
+ * parent interface.
*/
intf_plug ( &tmp, dest );
rc = xfer_vreopen ( dest, type, args );
if ( rc == 0 ) {
xfer_window_changed ( dest );
xfer_window_changed ( &tmp );
+ } else {
+ intf_close ( &tmp, rc );
}
intf_unplug ( &tmp );
}