Re: [PATCH v6 2/2] net/tls: Add kernel APIs for requesting a TLSv1.3 handshake

Jakub Kicinski
2023-03-04T02:23:25Z

On Fri, 03 Mar 2023 13:51:38 -0500 Chuck Lever wrote:
> + ret = -EMSGSIZE;
> + ret = nla_put_u32(msg, HANDSHAKE_A_ACCEPT_SOCKFD, fd);
> + if (ret < 0)
> + goto out_cancel;
> + ret = nla_put_u32(msg, HANDSHAKE_A_ACCEPT_MESSAGE_TYPE, treq->th_type);
> + if (ret < 0)
> + goto out_cancel;

feel free to do:

if (nla_put_u32(msg, ...) ||
nla_put_u32(msg, ...))
goto out_cancel;

we assume this helper can only return -EMSGSIZE or 0 in so many places
it's unlikely to ever change..