Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Mar 2018 20:49:52 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330947 - head/sys/dev/cxgbe/tom
Message-ID:  <201803142049.w2EKnqdY069828@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803142049.w2EKnqdY069828>