summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorMichael Brown2006-12-22 14:04:50 +0100
committerMichael Brown2006-12-22 14:04:50 +0100
commit4cc1c1bd4c5bfd697c9efff55c6492943dd2919c (patch)
tree41a5867a4e1294ad8015f174424ef7b310fc14eb /src/net
parentCannot immediately overwrite the peer address when we parse (diff)
downloadipxe-4cc1c1bd4c5bfd697c9efff55c6492943dd2919c.tar.gz
ipxe-4cc1c1bd4c5bfd697c9efff55c6492943dd2919c.tar.xz
ipxe-4cc1c1bd4c5bfd697c9efff55c6492943dd2919c.zip
Ensure that old TCP connection state is destroyed before attempting to
reopen connection. (The TCP API will soon change to render this step unnecessary.)
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tcp/iscsi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c
index 27e394cf7..a0137dc56 100644
--- a/src/net/tcp/iscsi.c
+++ b/src/net/tcp/iscsi.c
@@ -1098,6 +1098,9 @@ static void iscsi_newdata ( struct tcp_connection *conn, void *data,
}
}
+#warning "Remove me soon"
+static struct tcp_operations iscsi_tcp_operations;
+
/**
* Handle TCP connection closure
*
@@ -1122,6 +1125,8 @@ static void iscsi_closed ( struct tcp_connection *conn, int status ) {
if ( ++iscsi->retry_count <= ISCSI_MAX_RETRIES ) {
DBG ( "iSCSI %p retrying connection\n", iscsi );
/* Re-copy address to handle redirection */
+ memset ( &iscsi->tcp, 0, sizeof ( iscsi->tcp ) );
+ iscsi->tcp.tcp_op = &iscsi_tcp_operations;
memcpy ( &iscsi->tcp.peer, &iscsi->target,
sizeof ( iscsi->tcp.peer ) );
tcp_connect ( conn );