diff options
author | Paolo Abeni <pabeni@redhat.com> | 2023-04-14 16:08:03 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-04-17 09:18:34 +0200 |
commit | ddb1a072f858704b3555876877ca38c5b103a215 (patch) | |
tree | 6a0c776a01eaf05c6cd6b86ce20f8a1d1323fdac /net/mptcp/pm_netlink.c | |
parent | mptcp: move fastopen subflow check inside mptcp_sendmsg_fastopen() (diff) | |
download | linux-ddb1a072f858704b3555876877ca38c5b103a215.tar.xz linux-ddb1a072f858704b3555876877ca38c5b103a215.zip |
mptcp: move first subflow allocation at mpc access time
In the long run this will simplify the mptcp code and will
allow for more consistent behavior. Move the first subflow
allocation out of the sock->init ops into the __mptcp_nmpc_socket()
helper.
Since the first subflow creation can now happen after the first
setsockopt() we additionally need to invoke mptcp_sockopt_sync()
on it.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/pm_netlink.c')
-rw-r--r-- | net/mptcp/pm_netlink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 1c42bebca39e..bc343dab5e3f 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1035,8 +1035,8 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk, lock_sock(newsk); ssock = __mptcp_nmpc_socket(mptcp_sk(newsk)); release_sock(newsk); - if (!ssock) - return -EINVAL; + if (IS_ERR(ssock)) + return PTR_ERR(ssock); mptcp_info2sockaddr(&entry->addr, &addr, entry->addr.family); #if IS_ENABLED(CONFIG_MPTCP_IPV6) |