summaryrefslogtreecommitdiffstats
path: root/src/net/tcp
diff options
context:
space:
mode:
authorMichael Brown2016-11-17 00:00:57 +0100
committerMichael Brown2016-11-17 00:03:37 +0100
commit81fceaec6eea05efb942a188c3d92dd73a1a8aa0 (patch)
treecc0eaf51e5af5c48de3696889aed1b581fb16dd9 /src/net/tcp
parent[interface] Provide intf_reinit() to reinitialise nullified interfaces (diff)
downloadipxe-81fceaec6eea05efb942a188c3d92dd73a1a8aa0.tar.gz
ipxe-81fceaec6eea05efb942a188c3d92dd73a1a8aa0.tar.xz
ipxe-81fceaec6eea05efb942a188c3d92dd73a1a8aa0.zip
[iscsi] Avoid potential infinite loops during shutdown
The command and data interfaces may be connected to the same object. Nullify the data interface before shutting down the control interface to avoid potential infinite loops. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/tcp')
-rw-r--r--src/net/tcp/iscsi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c
index ec004e4b..d6f80084 100644
--- a/src/net/tcp/iscsi.c
+++ b/src/net/tcp/iscsi.c
@@ -231,6 +231,7 @@ static void iscsi_close ( struct iscsi_session *iscsi, int rc ) {
process_del ( &iscsi->process );
/* Shut down interfaces */
+ intf_nullify ( &iscsi->data ); /* avoid potential loops */
intf_shutdown ( &iscsi->socket, rc );
intf_shutdown ( &iscsi->control, rc );
intf_shutdown ( &iscsi->data, rc );