Index: sys/dev/iscsi/icl.h =================================================================== --- sys/dev/iscsi/icl.h +++ sys/dev/iscsi/icl.h @@ -161,8 +161,7 @@ int icl_listen_remove(struct icl_listen *il, struct sockaddr *sa); /* - * Those two are not a public API; only to be used between icl_soft.c - * and icl_soft_proxy.c. + * Those two are used between icl_soft.c and icl_soft_proxy.c. */ int icl_soft_handoff_sock(struct icl_conn *ic, struct socket *so); int icl_soft_proxy_connect(struct icl_conn *ic, int domain, Index: sys/dev/iscsi/iscsi_login.c =================================================================== --- sys/dev/iscsi/iscsi_login.c +++ sys/dev/iscsi/iscsi_login.c @@ -167,76 +167,12 @@ } /* - * XXX: The way it works is suboptimal; what should happen is described - * in draft-gilligan-iscsi-fault-tolerance-00. That, however, would - * be much more complicated: we would need to keep "dependencies" - * for sessions, so that, in case described in draft and using draft - * terminology, we would have three sessions: one for discovery, - * one for initial target portal, and one for redirect portal. - * This would allow us to "backtrack" on connection failure, - * as described in draft. + * XXX: Currently redirection is not supported */ static int login_handle_redirection(struct iscsi_session *is, struct icl_pdu *response) { -#ifdef __notyet__ - struct iscsi_bhs_login_response *bhslr; - struct iscsi_keys *response_keys; - const char *target_address; - struct sockaddr_in6 *sin6; - struct sockaddr_in *sin; - int error; - - bhslr = (struct iscsi_bhs_login_response *)response->ip_bhs; - if (bhslr->bhslr_status_class != 1) { - printf("iscsi: received unknown status class %d\n", - bhslr->bhslr_status_class); - return (EPROTO); - } - - response_keys = iscsi_keys_new(M_NOWAIT); - if (response_keys == NULL) - return (ENOMEM); - error = iscsi_keys_load(response_keys, response, M_NOWAIT); - if (error != 0) - return (error); - - target_address = iscsi_keys_find(response_keys, "TargetAddress"); - if (target_address == NULL) { - printf("iscsi: received redirection without TargetAddress\n"); - return (EPROTO); - } - if (target_address[0] == '\0') { - printf("iscsi: received redirection with empty TargetAddress\n"); - return (EPROTO); - } - if (strlen(target_address) >= sizeof(is->is_conf.isc_target_addr)) { - printf("iscsi: received TargetAddress is too long\n"); - return (EPROTO); - } - - printf("iscsi: received redirection to \"%s\"\n", target_address); - bzero(is->is_conf.isc_target_addr, sizeof(is->is_conf.isc_target_addr)); - strlcpy(is->is_conf.isc_target_addr, target_address, - sizeof(is->is_conf.isc_target_addr)); - sin6 = (struct sockaddr_in6 *)&is->is_from_sa; - sin6->sin6_len = sizeof(*sin6); - sin6->sin6_family = AF_INET6; - if (inet_pton(AF_INET6, target_address, &sin6->sin6_addr) != 1) { - sin = (struct sockaddr_in *)&is->is_from_sa; - sin->sin_len = sizeof(*sin); - sin->sin_family = AF_INET; - if (inet_pton(AF_INET, target_address, &sin->sin_addr) != 1) - error = EOPNOTSUPP; - } else { - if (inet_pton(AF_INET, target_address, &sin->sin_addr) != 1) - error = EOPNOTSUPP; - } - iscsi_keys_delete(response_keys); - return (error); -#else return (EOPNOTSUPP); -#endif } @@ -682,8 +618,8 @@ break; } - //log_debugx("received login response " - // "without the \"T\" flag; sending another request"); + log_debugx("received login response " + "without the \"T\" flag; sending another request"); icl_pdu_free(response); response = NULL; @@ -700,7 +636,7 @@ } if (login_nsg(response) != BHSLR_STAGE_FULL_FEATURE_PHASE) { - printf( + log_warnx( "%s: received final login response with wrong NSG 0x%x\n", __func__, login_nsg(response)); }