Re: [PATCH net-next 2/2] udp: convert udp_lib_getsockopt to sockopt_t

From: Breno Leitao

Date: Fri Jun 12 2026 - 12:37:39 EST


Hello Willem,

On Fri, Jun 12, 2026 at 10:58:19AM -0400, Willem de Bruijn wrote:
> Breno Leitao wrote:
> > In preparation for converting the proto-layer getsockopt callbacks to the
> > sockopt_t interface, switch udp_lib_getsockopt() to take a sockopt_t.
>
> What is the benefit of this conversion?

This enables kernel callers (io_uring, bpf, etc.) to invoke getsockopt
directly. The setsockopt() conversion previously used sockptr, but
Linus objected to that approach and suggested iov_iter instead.

For full context, see:
https://lore.kernel.org/all/20260408-getsockopt-v3-0-061bb9cb355d@xxxxxxxxxx/

> It does add a lot more complexity and makes the code less obvious.

I agree this adds complexity. Unfortunately, I don't see a simpler way
to enable getsockopt to work with non-__user addresses.