~ubuntu-branches/ubuntu/oneiric/open-iscsi/oneiric

« back to all changes in this revision

Viewing changes to usr/discovery.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Zobel-Helas
  • Date: 2006-12-03 16:54:21 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20061203165421-udgd6i05ugt1byrh
Tags: upstream-2.0.730
ImportĀ upstreamĀ versionĀ 2.0.730

Show diffs side-by-side

added added

removed removed

Lines of Context:
670
670
        session->conn[0].max_recv_dlength = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
671
671
        session->conn[0].max_xmit_dlength = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
672
672
 
 
673
        session->reopen_cnt = config->reopen_max;
 
674
 
673
675
        /* OUI and uniqifying number */
674
676
        session->isid[0] = DRIVER_ISID_0;
675
677
        session->isid[1] = DRIVER_ISID_1;
1096
1098
                return 1;
1097
1099
        }
1098
1100
 
1099
 
        log_debug(4, "discovery timeouts: login %d, auth %d, active %d, "
1100
 
                 "idle %d, ping %d",
1101
 
                 session->conn[0].login_timeout, session->conn[0].auth_timeout,
1102
 
                 session->conn[0].active_timeout, session->conn[0].idle_timeout,
1103
 
                 session->conn[0].ping_timeout);
 
1101
        log_debug(4, "discovery timeouts: login %d, reopen_cnt %d, auth %d, "
 
1102
                 "active %d, idle %d, ping %d",
 
1103
                 session->conn[0].login_timeout, session->reopen_cnt,
 
1104
                 session->conn[0].auth_timeout, session->conn[0].active_timeout,
 
1105
                 session->conn[0].idle_timeout, session->conn[0].ping_timeout);
1104
1106
 
1105
1107
        /* setup authentication variables for the session*/
1106
1108
        rc = setup_authentication(session, config);
1116
1118
 
1117
1119
reconnect:
1118
1120
 
 
1121
        if (--session->reopen_cnt < 0) {
 
1122
                log_error("connection login retries (reopen_max) %d exceeded",
 
1123
                          config->reopen_max);
 
1124
                return 1;
 
1125
        }
 
1126
 
 
1127
redirect_reconnect:
 
1128
 
1119
1129
        iscsi_io_disconnect(&session->conn[0]);
1120
1130
 
1121
1131
        session->cmdsn = 1;
1216
1226
                        log_warning(
1217
1227
                                "discovery login temporarily redirected to "
1218
1228
                                "%s port %s", host, serv);
1219
 
                        goto reconnect;
 
1229
                        goto redirect_reconnect;
1220
1230
                case ISCSI_LOGIN_STATUS_TGT_MOVED_PERM:
1221
1231
                        log_warning(
1222
1232
                                "discovery login permanently redirected to "
1223
1233
                                "%s port %s", host, serv);
1224
1234
                        /* make the new address permanent */
1225
1235
                        ss = session->conn[0].saddr;
1226
 
                        goto reconnect;
 
1236
                        goto redirect_reconnect;
1227
1237
                default:
1228
1238
                        log_error(
1229
1239
                               "discovery login rejected: redirection type "