From owner-svn-src-all@freebsd.org Wed Mar 14 20:49:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91218F466E8; Wed, 14 Mar 2018 20:49:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA6F7620E; Wed, 14 Mar 2018 20:49:52 +0000 (UTC) (envelope-from jhb@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E61B4D32; Wed, 14 Mar 2018 20:49:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2EKnqbf069829; Wed, 14 Mar 2018 20:49:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2EKnqdY069828; Wed, 14 Mar 2018 20:49:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803142049.w2EKnqdY069828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 14 Mar 2018 20:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330947 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 330947 X-SVN-Commit-Repository: base 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.25 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: Wed, 14 Mar 2018 20:49:52 -0000 Author: jhb Date: Wed Mar 14 20:49:51 2018 New Revision: 330947 URL: https://svnweb.freebsd.org/changeset/base/330947 Log: Fix the check for an empty send socket buffer on a TOE TLS socket. Compare sbavail() with the cached sb_off of already-sent data instead of always comparing with zero. This will correctly close the connection and send the FIN if the socket buffer contains some previously-sent data but no unsent data. Reported by: Harsh Jain @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Wed Mar 14 20:46:25 2018 (r330946) +++ head/sys/dev/cxgbe/tom/t4_tls.c Wed Mar 14 20:49:51 2018 (r330947) @@ -1175,7 +1175,8 @@ t4_push_tls_records(struct adapter *sc, struct toepcb * Send a FIN if requested, but only if there's no * more data to send. */ - if (sbavail(sb) == 0 && toep->flags & TPF_SEND_FIN) { + if (sbavail(sb) == tls_ofld->sb_off && + toep->flags & TPF_SEND_FIN) { if (sowwakeup) sowwakeup_locked(so); else