mptcp: honor net namespace when creating subflow sk
Subsystems (2)
Florian Westphal
PATCH 1/1 mptcp: honor net namespace when creating subflow sk
Otherwise, even loopback communication doesn't work when program is run from non-init_netns.
Signed-off-by Florian Westphal <fw(a)strlen.de>
---
Could be squashed with
'mptcp: Make connection_list a real list of subflows'.
net/mptcp/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mptcp/protocol.c +2 -2
@@ -703,12 +703,12 @@ static struct proto mptcp_prot = {static int mptcp_subflow_create (struct sock *sk) {struct mptcp_sock *msk =mptcp_sk (sk); +struct net *net =sock_net (sk);struct socket *sf;int err;pr_debug ("msk=%p" , msk); - err =sock_create_kern (&init_net,PF_INET ,SOCK_STREAM ,IPPROTO_TCP , - &sf); + err =sock_create_kern (net,PF_INET ,SOCK_STREAM ,IPPROTO_TCP , &sf);if (!err) {lock_sock (sf->sk); err =tcp_set_ulp (sf->sk,"mptcp" );
Signature · 1 line
2.21.0
Mat Martineau
Quoted 7 lines · Florian Westphal
Otherwise, even loopback communication doesn't work when program is run from non-init_netns.
Signed-off-by Florian Westphal <fw(a)strlen.de>---
Could be squashed with
'mptcp: Makeconnection_lista real list of subflows'.
Thanks Florian. I'll squash it earlier in the series, where the sock_create_kern() call is added.
Mat
Quoted 25 lines
net/mptcp/protocol.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)net/mptcp/protocol.c +2
-2@@ -703,12 +703,12 @@ static struct proto mptcp_prot = {static int mptcp_subflow_create (struct sock *sk) {struct mptcp_sock *msk =mptcp_sk (sk); +struct net *net =sock_net (sk);struct socket *sf;int err;pr_debug ("msk=%p" , msk); - err =sock_create_kern (&init_net,PF_INET ,SOCK_STREAM ,IPPROTO_TCP , - &sf); + err =sock_create_kern (net,PF_INET ,SOCK_STREAM ,IPPROTO_TCP , &sf);if (!err) {lock_sock (sf->sk); err =tcp_set_ulp (sf->sk,"mptcp" );Signature · 1 line
2.21.0
--
Mat Martineau
Intel