Thread (20 messages) 20 messages, 5 authors, 2021-12-07

Re: [PATCH net-next 10/10] mptcp: support TCP_CORK and TCP_NODELAY

flat view

From: Florian Westphal <fw@strlen.de>
Date: 2021-12-07 10:19:28
Also in: mptcp

Jakub Kicinski [off-list ref] wrote:
On Fri,  3 Dec 2021 14:35:41 -0800 Mat Martineau wrote:
quoted
+static int mptcp_setsockopt_sol_tcp_nodelay(struct mptcp_sock *msk, sockptr_t optval,
+					    unsigned int optlen)
+{
+	struct mptcp_subflow_context *subflow;
+	struct sock *sk = (struct sock *)msk;
+	int val;
+
+	if (optlen < sizeof(int))
+		return -EINVAL;
+
+	if (copy_from_sockptr(&val, optval, sizeof(val)))
+		return -EFAULT;
Should we check that optval is not larger than sizeof(int) or if it is
that the rest of the buffer is zero? Or for the old school options we
should stick to the old school behavior?
My intent was to stick to tcp behaviour, i.e. no check on > sizeof(int)
or on "extra buffer" content.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help