From 3e95bd4ab92abca814bd28e854607d1975c7dc88 Mon Sep 17 00:00:00 2001 From: Anders Persson Date: Thu, 17 Jun 2010 17:22:09 -0700 Subject: PSARC/2009/590 Socket Filter Framework 6939085 Socket Filter Framework 6802067 connect_failed kernel socket callback is not triggered 6776450 time spent in tcp_close could be reduced/deferred to a worker thread 6828586 assertion failed: family == 26, file: ../../common/fs/sockfs/socksyscalls.c, line: 1608 6802078 kernel socket 'newconn' callback is passing rcv queue size as an argument --- usr/src/uts/common/syscall/sendfile.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'usr/src/uts/common/syscall/sendfile.c') diff --git a/usr/src/uts/common/syscall/sendfile.c b/usr/src/uts/common/syscall/sendfile.c index d279593b0f..29d8c5b564 100644 --- a/usr/src/uts/common/syscall/sendfile.c +++ b/usr/src/uts/common/syscall/sendfile.c @@ -20,8 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. */ #include @@ -781,8 +780,16 @@ sendvec_chunk(file_t *fp, u_offset_t *fileoff, struct sendfilevec *sfv, size_t iov_len; iov_len = sfv_len; - if (!SOCK_IS_NONSTR(so) && - SOTOTPI(so)->sti_kssl_ctx != NULL) + /* + * Socket filters can limit the mblk + * size, so limit reads to maxblk if + * there are filters present. + */ + if ((!SOCK_IS_NONSTR(so) && + _SOTOTPI(so)->sti_kssl_ctx + != NULL) || + (so->so_filter_active > 0 && + maxblk != INFPSZ)) iov_len = MIN(iov_len, maxblk); aiov.iov_len = iov_len; @@ -928,13 +935,16 @@ sendvec_chunk(file_t *fp, u_offset_t *fileoff, struct sendfilevec *sfv, copyflag = stp != NULL ? stp->sd_copyflag : so->so_proto_props.sopp_zcopyflag; + /* - * For sockets acting as an SSL proxy, we - * need to adjust the size to the maximum - * SSL record size set in the stream head. + * Socket filters can limit the mblk size, + * so limit reads to maxblk if there are + * filters present. */ - if (!SOCK_IS_NONSTR(so) && - _SOTOTPI(so)->sti_kssl_ctx != NULL) + if ((!SOCK_IS_NONSTR(so) && + _SOTOTPI(so)->sti_kssl_ctx != NULL) || + (so->so_filter_active > 0 && + maxblk != INFPSZ)) size = MIN(size, maxblk); if (vn_has_flocks(readvp) || -- cgit v1.2.3