mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 05:10:51 +07:00
net: use mptcp setsockopt function for SOL_SOCKET on mptcp sockets
setsockopt(mptcp_fd, SOL_SOCKET, ...)... appears to work (returns 0), but it has no effect -- this is because the MPTCP layer never has a chance to copy the settings to the subflow socket. Skip the generic handling for the mptcp case and instead call the mptcp specific handler instead for SOL_SOCKET too. Next patch adds more specific handling for SOL_SOCKET to mptcp. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f551e2fdaf
commit
83f0c10bc3
@ -1609,6 +1609,9 @@ static int mptcp_setsockopt(struct sock *sk, int level, int optname,
|
|||||||
|
|
||||||
pr_debug("msk=%p", msk);
|
pr_debug("msk=%p", msk);
|
||||||
|
|
||||||
|
if (level == SOL_SOCKET)
|
||||||
|
return sock_setsockopt(sk->sk_socket, level, optname, optval, optlen);
|
||||||
|
|
||||||
/* @@ the meaning of setsockopt() when the socket is connected and
|
/* @@ the meaning of setsockopt() when the socket is connected and
|
||||||
* there are multiple subflows is not yet defined. It is up to the
|
* there are multiple subflows is not yet defined. It is up to the
|
||||||
* MPTCP-level socket to configure the subflows until the subflow
|
* MPTCP-level socket to configure the subflows until the subflow
|
||||||
|
13
net/socket.c
13
net/socket.c
@ -2080,6 +2080,17 @@ SYSCALL_DEFINE4(recv, int, fd, void __user *, ubuf, size_t, size,
|
|||||||
return __sys_recvfrom(fd, ubuf, size, flags, NULL, NULL);
|
return __sys_recvfrom(fd, ubuf, size, flags, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool sock_use_custom_sol_socket(const struct socket *sock)
|
||||||
|
{
|
||||||
|
const struct sock *sk = sock->sk;
|
||||||
|
|
||||||
|
/* Use sock->ops->setsockopt() for MPTCP */
|
||||||
|
return IS_ENABLED(CONFIG_MPTCP) &&
|
||||||
|
sk->sk_protocol == IPPROTO_MPTCP &&
|
||||||
|
sk->sk_type == SOCK_STREAM &&
|
||||||
|
(sk->sk_family == AF_INET || sk->sk_family == AF_INET6);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set a socket option. Because we don't know the option lengths we have
|
* Set a socket option. Because we don't know the option lengths we have
|
||||||
* to pass the user mode parameter for the protocols to sort out.
|
* to pass the user mode parameter for the protocols to sort out.
|
||||||
@ -2118,7 +2129,7 @@ static int __sys_setsockopt(int fd, int level, int optname,
|
|||||||
optval = (char __user __force *)kernel_optval;
|
optval = (char __user __force *)kernel_optval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level == SOL_SOCKET)
|
if (level == SOL_SOCKET && !sock_use_custom_sol_socket(sock))
|
||||||
err =
|
err =
|
||||||
sock_setsockopt(sock, level, optname, optval,
|
sock_setsockopt(sock, level, optname, optval,
|
||||||
optlen);
|
optlen);
|
||||||
|
Loading…
Reference in New Issue
Block a user