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)
Sat, May 4, 2:53 PM
Unknown Object (File)
Sat, May 4, 2:30 PM
Unknown Object (File)
Sat, May 4, 2:28 PM
Unknown Object (File)
Fri, May 3, 8:10 AM
Unknown Object (File)
Nov 26 2023, 3:31 PM
Unknown Object (File)
Nov 11 2023, 2:50 PM
Unknown Object (File)
Oct 10 2023, 1:51 PM
Unknown Object (File)
Oct 6 2023, 2:50 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