summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/syscall/sendfile.c
diff options
context:
space:
mode:
authorAnders Persson <Anders.Persson@Sun.COM>2010-06-17 17:22:09 -0700
committerAnders Persson <Anders.Persson@Sun.COM>2010-06-17 17:22:09 -0700
commit3e95bd4ab92abca814bd28e854607d1975c7dc88 (patch)
tree9f3088b26f62207198f0d44feca65b701fafb8dc /usr/src/uts/common/syscall/sendfile.c
parent8e51227711fb29b69b8f42a3953e759963432065 (diff)
downloadillumos-joyent-3e95bd4ab92abca814bd28e854607d1975c7dc88.tar.gz
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
Diffstat (limited to 'usr/src/uts/common/syscall/sendfile.c')
-rw-r--r--usr/src/uts/common/syscall/sendfile.c28
1 files changed, 19 insertions, 9 deletions
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 <sys/types.h>
@@ -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) ||