6847403 tcp_fuse() leak stroptions mblk when re-fuse'ing
authorAnders Persson <Anders.Persson@Sun.COM>
Mon, 29 Jun 2009 13:59:59 -0700
changeset 9995 d626655ec3b9
parent 9994 99552628e44c
child 9996 c439ba713aee
6847403 tcp_fuse() leak stroptions mblk when re-fuse'ing
usr/src/uts/common/inet/tcp/tcp_fusion.c
--- a/usr/src/uts/common/inet/tcp/tcp_fusion.c	Mon Jun 29 13:59:59 2009 -0700
+++ b/usr/src/uts/common/inet/tcp/tcp_fusion.c	Mon Jun 29 13:59:59 2009 -0700
@@ -316,8 +316,6 @@
 				stropt->so_hiwat = tcp_fuse_set_rcv_hiwat(
 				    peer_tcp, peer_rq->q_hiwat);
 
-				tcp->tcp_refuse = B_FALSE;
-				peer_tcp->tcp_refuse = B_FALSE;
 				/* Send the options up */
 				putnext(peer_rq, mp);
 			} else {
@@ -339,6 +337,14 @@
 				(*peer_connp->conn_upcalls->su_set_proto_props)
 				    (peer_connp->conn_upper_handle, &sopp);
 			}
+		} else {
+			/*
+			 * Endpoints are being re-fused, so options will not
+			 * be sent up. In case of STREAMS, free the stroptions
+			 * mblk.
+			 */
+			if (!IPCL_IS_NONSTR(connp))
+				freemsg(mp);
 		}
 		tcp->tcp_refuse = B_FALSE;
 		peer_tcp->tcp_refuse = B_FALSE;