From owner-svn-src-all@freebsd.org Thu May 19 14:59:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26487B42D1F; Thu, 19 May 2016 14:59:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E489A16D1; Thu, 19 May 2016 14:59:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JExMX5095184; Thu, 19 May 2016 14:59:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4JExM46095183; Thu, 19 May 2016 14:59:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605191459.u4JExM46095183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 19 May 2016 14:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300212 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 14:59:23 -0000 Author: trasz Date: Thu May 19 14:59:21 2016 New Revision: 300212 URL: https://svnweb.freebsd.org/changeset/base/300212 Log: When iscsid(8) is running in ICL proxy mode, don't try to send Logout PDUs. The kernel already does this for us when we ask it to terminate the session. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/discovery.c Modified: head/usr.sbin/iscsid/discovery.c ============================================================================== --- head/usr.sbin/iscsid/discovery.c Thu May 19 14:57:37 2016 (r300211) +++ head/usr.sbin/iscsid/discovery.c Thu May 19 14:59:21 2016 (r300212) @@ -206,6 +206,18 @@ discovery(struct connection *conn) log_debugx("removing temporary discovery session"); kernel_remove(conn); +#ifdef ICL_KERNEL_PROXY + if (conn->conn_conf.isc_iser == 1) { + /* + * If we're going through the proxy, the kernel already + * sent Logout PDU for us and destroyed the session, + * so we can't send anything anymore. + */ + log_debugx("discovery session done"); + return; + } +#endif + log_debugx("discovery done; logging out"); request = logout_new_request(conn); pdu_send(request);