diff options
| author | Paolo Abeni <[email protected]> | 2022-10-20 17:48:51 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-10-24 09:52:50 +0000 |
| commit | a5ef058dc4d9a3e60d1808a0700e18e0e37e408e (patch) | |
| tree | 2cda419cd35a4ed16b361aeb82b25a5f55675a0a /net/mptcp/protocol.c | |
| parent | Merge branch 'net-800Gbps-support' (diff) | |
| download | kernel-a5ef058dc4d9a3e60d1808a0700e18e0e37e408e.tar.gz kernel-a5ef058dc4d9a3e60d1808a0700e18e0e37e408e.zip | |
net: introduce and use custom sockopt socket flag
We will soon introduce custom setsockopt for UDP sockets, too.
Instead of doing even more complex arbitrary checks inside
sock_use_custom_sol_socket(), add a new socket flag and set it
for the relevant socket types (currently only MPTCP).
Reviewed-by: Matthieu Baerts <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Acked-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/mptcp/protocol.c')
| -rw-r--r-- | net/mptcp/protocol.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 2e16c897c229..e60d144bfb2d 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2708,6 +2708,8 @@ static int mptcp_init_sock(struct sock *sk) if (ret) return ret; + set_bit(SOCK_CUSTOM_SOCKOPT, &sk->sk_socket->flags); + /* fetch the ca name; do it outside __mptcp_init_sock(), so that clone will * propagate the correct value */ @@ -3684,6 +3686,8 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock, struct mptcp_subflow_context *subflow; struct sock *newsk = newsock->sk; + set_bit(SOCK_CUSTOM_SOCKOPT, &newsock->flags); + lock_sock(newsk); /* PM/worker can now acquire the first subflow socket |
