From owner-freebsd-bugs@FreeBSD.ORG Tue Aug 26 16:47:01 2014 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FC83ACB for ; Tue, 26 Aug 2014 16:47:01 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 667F53B1D for ; Tue, 26 Aug 2014 16:47:01 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id s7QGl1Nx011469 for ; Tue, 26 Aug 2014 16:47:01 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 193021] New: usr.sbin/ctld/login.c do not reply TargetPortalGroupTag in Login response Date: Tue, 26 Aug 2014 16:47:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: pokkys@gmail.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2014 16:47:01 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D193021 Bug ID: 193021 Summary: usr.sbin/ctld/login.c do not reply TargetPortalGroupTag in Login response Product: Base System Version: 10.0-RELEASE Hardware: amd64 OS: Any Status: Needs Triage Severity: Affects Many People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: pokkys@gmail.com Hi I am a mac user, when I try to use xtendsan iSCSI initiator to connect nati= ve iSCSI target, I found that the login response pdu do not have TargetPortalGroupTag key-pair. xtendsan told me TargetPortalGroupTag is missing and disconnected. I try to do a workaround to it and it works. Add some codes in usr.sbin/ctld/login.c:login_negotiate() login_negotiate(struct connection *conn, struct pdu *request) { struct pdu *response; struct iscsi_bhs_login_response *bhslr2; struct keys *request_keys, *response_keys; int i; bool skipped_security; char *portal_group_tag; int rv; if (request =3D=3D NULL) { log_debugx("beginning parameter negotiation; " "waiting for Login PDU"); request =3D login_receive(conn, false); skipped_security =3D false; } else skipped_security =3D true; request_keys =3D keys_new(); keys_load(request_keys, request); response =3D login_new_response(request); bhslr2 =3D (struct iscsi_bhs_login_response *)response->pdu_bhs; bhslr2->bhslr_flags |=3D BHSLR_FLAGS_TRANSIT; bhslr2->bhslr_tsih =3D htons(0xbadd); login_set_csg(response, BHSLR_STAGE_OPERATIONAL_NEGOTIATION); login_set_nsg(response, BHSLR_STAGE_FULL_FEATURE_PHASE); response_keys =3D keys_new(); if (conn->conn_session_type =3D=3D CONN_SESSION_TYPE_NORMAL) { if (conn->conn_target->t_alias !=3D NULL) keys_add(response_keys, "TargetAlias", conn->conn_target->t_alias); rv =3D asprintf(&portal_group_tag, "%d", conn->conn_portal->p_portal_group->pg_tag); if (rv <=3D 0) log_err(1, "asprintf"); keys_add(response_keys, "TargetPortalGroupTag", portal_group_tag); free(portal_group_tag); }=20=20=20 for (i =3D 0; i < KEYS_MAX; i++) { if (request_keys->keys_names[i] =3D=3D NULL) break; login_negotiate_key(request, request_keys->keys_names[i], request_keys->keys_values[i], skipped_security, response_keys); } I don=E2=80=99t read whole iSCSI RFC, is this right to add missing TargetPortalGroupTag? Maybe you have better solution to fix this, please help me and thanks. --=20 You are receiving this mail because: You are the assignee for the bug.=