1232 bzero(&t_addr, sizeof (struct sockaddr_in6));
1233 t_addrlen = sizeof (struct sockaddr_in6);
1234 mutex_enter(&svc->is_mutex);
1235
1236 so_svc = svc->is_so_svc;
1237 so_svc->is_thread_running = B_TRUE;
1238 so_svc->is_thread_did = so_svc->is_thread->t_did;
1239
1240 cv_signal(&svc->is_cv);
1241
1242 IDM_SVC_LOG(CE_NOTE, "iSCSI service (%p/%d) online", (void *)svc,
1243 svc->is_svc_req.sr_port);
1244
1245 while (so_svc->is_thread_running) {
1246 mutex_exit(&svc->is_mutex);
1247
1248 if ((rc = ksocket_accept(so_svc->is_so,
1249 (struct sockaddr *)&t_addr, &t_addrlen,
1250 &new_so, CRED())) != 0) {
1251 mutex_enter(&svc->is_mutex);
1252 if (rc == ECONNABORTED)
1253 continue;
1254 /* Connection problem */
1255 break;
1256 }
1257 /*
1258 * Turn off SO_MAC_EXEMPT so future sobinds succeed
1259 */
1260 (void) ksocket_setsockopt(new_so, SOL_SOCKET, SO_MAC_EXEMPT,
1261 (char *)&off, sizeof (off), CRED());
1262
1263 idmrc = idm_svc_conn_create(svc, IDM_TRANSPORT_TYPE_SOCKETS,
1264 &ic);
1265 if (idmrc != IDM_STATUS_SUCCESS) {
1266 /* Drop connection */
1267 idm_soshutdown(new_so);
1268 idm_sodestroy(new_so);
1269 mutex_enter(&svc->is_mutex);
1270 continue;
1271 }
1272
1273 idmrc = idm_so_tgt_conn_create(ic, new_so);
1274 if (idmrc != IDM_STATUS_SUCCESS) {
1275 idm_svc_conn_destroy(ic);
|
1232 bzero(&t_addr, sizeof (struct sockaddr_in6));
1233 t_addrlen = sizeof (struct sockaddr_in6);
1234 mutex_enter(&svc->is_mutex);
1235
1236 so_svc = svc->is_so_svc;
1237 so_svc->is_thread_running = B_TRUE;
1238 so_svc->is_thread_did = so_svc->is_thread->t_did;
1239
1240 cv_signal(&svc->is_cv);
1241
1242 IDM_SVC_LOG(CE_NOTE, "iSCSI service (%p/%d) online", (void *)svc,
1243 svc->is_svc_req.sr_port);
1244
1245 while (so_svc->is_thread_running) {
1246 mutex_exit(&svc->is_mutex);
1247
1248 if ((rc = ksocket_accept(so_svc->is_so,
1249 (struct sockaddr *)&t_addr, &t_addrlen,
1250 &new_so, CRED())) != 0) {
1251 mutex_enter(&svc->is_mutex);
1252 if (rc != ECONNABORTED && rc != EINTR) {
1253 IDM_SVC_LOG(CE_NOTE, "idm_so_svc_port_watcher:"
1254 " ksocket_accept failed %d", rc);
1255 }
1256 /*
1257 * Unclean shutdown of this thread is not handled
1258 * wait for !is_thread_running.
1259 */
1260 continue;
1261 }
1262 /*
1263 * Turn off SO_MAC_EXEMPT so future sobinds succeed
1264 */
1265 (void) ksocket_setsockopt(new_so, SOL_SOCKET, SO_MAC_EXEMPT,
1266 (char *)&off, sizeof (off), CRED());
1267
1268 idmrc = idm_svc_conn_create(svc, IDM_TRANSPORT_TYPE_SOCKETS,
1269 &ic);
1270 if (idmrc != IDM_STATUS_SUCCESS) {
1271 /* Drop connection */
1272 idm_soshutdown(new_so);
1273 idm_sodestroy(new_so);
1274 mutex_enter(&svc->is_mutex);
1275 continue;
1276 }
1277
1278 idmrc = idm_so_tgt_conn_create(ic, new_so);
1279 if (idmrc != IDM_STATUS_SUCCESS) {
1280 idm_svc_conn_destroy(ic);
|