changeset 3661:42a018c1e567

6460268 Connection is refused on local unix socket when many connect/close request are generated in one time
author akolb
date Thu, 15 Feb 2007 11:50:23 -0800
parents 1532d6e91300
children d7848fb68fba
files usr/src/uts/common/io/tl.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/tl.c	Thu Feb 15 11:12:06 2007 -0800
+++ b/usr/src/uts/common/io/tl.c	Thu Feb 15 11:50:23 2007 -0800
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -2971,15 +2971,10 @@
 		(void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE,
 			"tl_conn_req: qlen overflow connection refused"));
 			err = ECONNREFUSED;
-	} else if (!((peer_tep->te_state == TS_IDLE) ||
-			(peer_tep->te_state == TS_WRES_CIND))) {
-		(void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE,
-			"tl_conn_req:peer in bad state"));
-		err = ECONNREFUSED;
 	}
 
 	/*
-	 * preallocate now for T_DISCON_IND or T_CONN_IND
+	 * Send T_DISCON_IND in case of error
 	 */
 	if (err != 0) {
 		if (peer_tep != NULL)
@@ -3078,6 +3073,9 @@
 	if (peer_tep->te_closing ||
 	    !((peer_tep->te_state == TS_IDLE) ||
 		(peer_tep->te_state == TS_WRES_CIND))) {
+		(void) (STRLOG(TL_ID, tep->te_minor, 2, SL_TRACE | SL_ERROR,
+			"tl_conn_req:peer in bad state (%d)",
+			    peer_tep->te_state));
 		TL_UNCONNECT(tep->te_oconp);
 		tl_error_ack(wq, mp, TSYSERR, ECONNREFUSED, T_CONN_REQ);
 		freemsg(ackmp);