Browse Source

Ensure that old TCP connection state is destroyed before attempting to

reopen connection.  (The TCP API will soon change to render this step
unnecessary.)
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
4cc1c1bd4c
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/net/tcp/iscsi.c

+ 5
- 0
src/net/tcp/iscsi.c View File

@@ -1098,6 +1098,9 @@ static void iscsi_newdata ( struct tcp_connection *conn, void *data,
1098 1098
 	}
1099 1099
 }
1100 1100
 
1101
+#warning "Remove me soon"
1102
+static struct tcp_operations iscsi_tcp_operations;
1103
+
1101 1104
 /**
1102 1105
  * Handle TCP connection closure
1103 1106
  *
@@ -1122,6 +1125,8 @@ static void iscsi_closed ( struct tcp_connection *conn, int status ) {
1122 1125
 	if ( ++iscsi->retry_count <= ISCSI_MAX_RETRIES ) {
1123 1126
 		DBG ( "iSCSI %p retrying connection\n", iscsi );
1124 1127
 		/* Re-copy address to handle redirection */
1128
+		memset ( &iscsi->tcp, 0, sizeof ( iscsi->tcp ) );
1129
+		iscsi->tcp.tcp_op = &iscsi_tcp_operations;
1125 1130
 		memcpy ( &iscsi->tcp.peer, &iscsi->target,
1126 1131
 			 sizeof ( iscsi->tcp.peer ) );
1127 1132
 		tcp_connect ( conn );

Loading…
Cancel
Save