HomeFreeBSD

Fix sosend_generic() so that it can handle a list of ext_pgs mbufs.

Description

Fix sosend_generic() so that it can handle a list of ext_pgs mbufs.

Without this patch, sosend_generic() will try to use top->m_pkthdr.len,
assuming that the first mbuf has a pkthdr.
When a list of ext_pgs mbufs is passed in, the first mbuf is not a
pkthdr and cannot be post-r359919. As such, the value of top->m_pkthdr.len
is bogus (0 for my testing).
This patch fixes sosend_generic() to handle this case, calculating the
total length via m_length() for this case.

There is currently nothing that hands a list of ext_pgs mbufs to
sosend_generic(), but the nfs-over-tls kernel RPC code in
projects/nfs-over-tls will do that and was used to test this patch.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24568

Details

Provenance
rmacklemAuthored on
Reviewer
gallatin
Differential Revision
D24568: fix sosend_generic() so that it can handle a list of ext_pgs mbufs post r359919
Parents
rS360415: MFC r359978:
Branches
Unknown
Tags
Unknown