From owner-svn-src-stable@freebsd.org Tue Jul 24 13:13:31 2018 Return-Path: Delivered-To: svn-src-stable@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 4084D104B801; Tue, 24 Jul 2018 13:13:31 +0000 (UTC) (envelope-from np@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 D31578E962; Tue, 24 Jul 2018 13:13:30 +0000 (UTC) (envelope-from np@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 AE5ED40D6; Tue, 24 Jul 2018 13:13:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6ODDUd0029699; Tue, 24 Jul 2018 13:13:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6ODDUs8029698; Tue, 24 Jul 2018 13:13:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201807241313.w6ODDUs8029698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 24 Jul 2018 13:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336667 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 336667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 13:13:31 -0000 Author: np Date: Tue Jul 24 13:13:30 2018 New Revision: 336667 URL: https://svnweb.freebsd.org/changeset/base/336667 Log: cxgbe/iw_cxgbe: Do not call soaccept twice on the same socket. This is a direct commit to stable/11. Reported by: Sai Tallamraju @ Netapp Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jul 24 12:55:54 2018 (r336666) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Tue Jul 24 13:13:30 2018 (r336667) @@ -947,7 +947,6 @@ process_newconn(struct c4iw_listen_ep *master_lep, str { struct c4iw_listen_ep *real_lep = NULL; struct c4iw_ep *new_ep = NULL; - struct sockaddr_in *remote = NULL; int ret = 0; MPASS(new_so != NULL); @@ -992,20 +991,6 @@ process_newconn(struct c4iw_listen_ep *master_lep, str START_EP_TIMER(new_ep); setiwsockopt(new_so); - ret = soaccept(new_so, (struct sockaddr **)&remote); - if (ret != 0) { - CTR4(KTR_IW_CXGBE, - "%s:listen sock:%p, new sock:%p, ret:%d\n", - __func__, master_lep->com.so, new_so, ret); - if (remote != NULL) - free(remote, M_SONAME); - uninit_iwarp_socket(new_so); - soclose(new_so); - c4iw_put_ep(&new_ep->com); - c4iw_put_ep(&real_lep->com); - return; - } - free(remote, M_SONAME); /* MPA request might have been queued up on the socket already, so we * initialize the socket/upcall_handler under lock to prevent processing @@ -1118,8 +1103,10 @@ dequeue_socket(struct socket *head) SOCK_UNLOCK(so); ACCEPT_UNLOCK(); remote = NULL; - soaccept(so, (struct sockaddr **)&remote); - + if (soaccept(so, (struct sockaddr **)&remote) != 0) { + soclose(so); + so = NULL; + } free(remote, M_SONAME); return so; }