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

Loading…
Cancel
Save