Page MenuHomeFreeBSD

fix sosend_generic() so that it can handle a list of ext_pgs mbufs post r359919
ClosedPublic

Authored by rmacklem on Apr 24 2020, 11:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 24, 11:45 AM
Unknown Object (File)
Fri, Mar 21, 12:54 AM
Unknown Object (File)
Fri, Mar 7, 11:33 AM
Unknown Object (File)
Fri, Mar 7, 11:32 AM
Unknown Object (File)
Fri, Mar 7, 11:30 AM
Unknown Object (File)
Feb 13 2025, 12:06 PM
Unknown Object (File)
Feb 13 2025, 11:46 AM
Unknown Object (File)
Feb 13 2025, 7:28 AM
Subscribers

Details

Summary

r359919 modified "struct mbuf" so that a ext_pgs mbuf could not have
a pkthdr. As such, when I list of ext_pgs mbufs is passed into sosend_generic,
it would fail, since it would try and use a field as m_pkthdr.len (usually 0 fortunately).

This little patch adds code to check for M_PKTHDR and calculates the length
via m_length() if not.

Test Plan

This has been tested with the code in base/projects/nfs-over-tls, which
generates the NFS RPC messages in a list of ext_pgs mbufs when
KERN_TLS will be used to send them.

Since there are no cases where sosend_generic() is called with a
list of ext_pgs mbufs in base/head, the above should be the only
use case for now.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable