# Re: \[PATCH 2/2\] tls: return a distinct error for control records from read\_sock

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2026-09-23 00:56:57 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/09/17625534
- Thread: https://ratatoskr.run/linux-nvme/2026/09/17622403/t.md

```text
On Tue, 22 Sep 2026 15:37:08 +0200 Hannes Reinecke wrote:
> tls_sw_read_sock() leaves a non-data record on the receive list and
> returns -EINVAL. The same function returns -EINVAL when an sk_psock is
> attached, and an actor may return it for other reasons, so callers
> cannot determine whether a control record is waiting.
> 
> Return -EPROTO instead. The record can then be read with recvmsg()
> and a control buffer, which reports its type.

Please run the selftests.
-- 
pw-bot: cr
```
