]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[xfer] Use xfer_alloc_iob() for transmit I/O buffers on stream sockets
authorMichael Brown <mcb30@ipxe.org>
Sun, 30 Mar 2025 20:47:34 +0000 (21:47 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 30 Mar 2025 20:47:34 +0000 (21:47 +0100)
commitd92551a320f32fa5d8fc8b2d2f02b174aa6fab66
treeab752667bbc830002e4fcab6fec6d943fd5366f9
parent3937c893ae9eb1fd7a6e252b671f5d93a8da6d57
[xfer] Use xfer_alloc_iob() for transmit I/O buffers on stream sockets

Datagram sockets such as UDP, ICMP, and fibre channel tend to provide
a custom xfer_alloc_iob() handler to ensure that transmit I/O buffers
contain sufficient headroom to accommodate any required protocol
headers.

Stream sockets such as TCP and TLS do not typically provide a custom
xfer_alloc_iob() handler at present.  The default handler simply calls
alloc_iob(), and so stream socket consumers can therefore get away
with using alloc_iob() rather than xfer_alloc_iob().

Fix the HTTP and ONC RPC protocols to use xfer_alloc_iob() where
relevant, in order to operate correctly if the underlying stream
socket chooses to provide a custom xfer_alloc_iob() handler.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tcp/httpcore.c
src/net/tcp/oncrpc.c