summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/streamio.c
diff options
context:
space:
mode:
authorvk199839 <none@none>2008-01-17 02:31:55 -0800
committervk199839 <none@none>2008-01-17 02:31:55 -0800
commit51dd2c77f06e5663c28bd4f7a760cae4cf159e79 (patch)
treec4d7c133df6530809f178a592ef47aceb5298bdd /usr/src/uts/common/os/streamio.c
parenteae0da433d3586e2e73eb5d63efc6200bf8984a8 (diff)
downloadillumos-joyent-51dd2c77f06e5663c28bd4f7a760cae4cf159e79.tar.gz
6556447 better observability for kssl
6614159 kstrgetmsg()/struiocopyout() are greedy monsters lurking for raw kssl data 6641496 incoming TCP segments destined for KSSL lost when received out-of-order --HG-- rename : usr/src/uts/common/inet/kssl/kssldebug.h => deleted_files/usr/src/uts/common/inet/kssl/kssldebug.h
Diffstat (limited to 'usr/src/uts/common/os/streamio.c')
-rw-r--r--usr/src/uts/common/os/streamio.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c
index 80c5ad6c8b..2bbbca12b6 100644
--- a/usr/src/uts/common/os/streamio.c
+++ b/usr/src/uts/common/os/streamio.c
@@ -23,7 +23,7 @@
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -7168,17 +7168,31 @@ retry:
stp->sd_flag |= STRGETINPROG;
mutex_exit(&stp->sd_lock);
- if ((stp->sd_rputdatafunc != NULL) && (DB_TYPE(bp) == M_DATA) &&
- (!(DB_FLAGS(bp) & DBLK_COOKED))) {
+ if ((stp->sd_rputdatafunc != NULL) && (DB_TYPE(bp) == M_DATA)) {
+ mblk_t *tmp, *prevmp;
- bp = (stp->sd_rputdatafunc)(
- stp->sd_vnode, bp, NULL,
- NULL, NULL, NULL);
+ /*
+ * Put first non-data mblk back to stream head and
+ * cut the mblk chain so sd_rputdatafunc only sees
+ * M_DATA mblks. We can skip the first mblk since it
+ * is M_DATA according to the condition above.
+ */
+ for (prevmp = bp, tmp = bp->b_cont; tmp != NULL;
+ prevmp = tmp, tmp = tmp->b_cont) {
+ if (DB_TYPE(tmp) != M_DATA) {
+ prevmp->b_cont = NULL;
+ mutex_enter(&stp->sd_lock);
+ putback(stp, q, tmp, tmp->b_band);
+ mutex_exit(&stp->sd_lock);
+ break;
+ }
+ }
+
+ bp = (stp->sd_rputdatafunc)(stp->sd_vnode, bp,
+ NULL, NULL, NULL, NULL);
if (bp == NULL)
goto retry;
-
- DB_FLAGS(bp) |= DBLK_COOKED;
}
if (STREAM_NEEDSERVICE(stp))