Author: rmacklem
Date: Wed May 27 23:20:35 2020
New Revision: 361567
URL: https://svnweb.freebsd.org/changeset/base/361567

Log:
  Fix sosend() for the case where mbufs are passed in while doing ktls.
  
  For kernel tls, sosend() needs to call ktls_frame() on the mbuf list
  to be sent.  Without this patch, this was only done when sosend()'s
  arguments used a uio_iov and not when an mbuf list is passed in.
  At this time, sosend() is never called with an mbuf list argument when
  kernel tls is in use, but will be once nfs-over-tls has been incorporated
  into head.
  
  Reviewed by:  gallatin, glebius
  Differential Revision:        https://reviews.freebsd.org/D24674

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c Wed May 27 22:48:34 2020        (r361566)
+++ head/sys/kern/uipc_socket.c Wed May 27 23:20:35 2020        (r361567)
@@ -1678,6 +1678,13 @@ restart:
                                resid = 0;
                                if (flags & MSG_EOR)
                                        top->m_flags |= M_EOR;
+#ifdef KERN_TLS
+                               if (tls != NULL) {
+                                       ktls_frame(top, tls, &tls_enq_cnt,
+                                           tls_rtype);
+                                       tls_rtype = TLS_RLTYPE_APP;
+                               }
+#endif
                        } else {
                                /*
                                 * Copy the data from userland into a mbuf
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to