Commit a963853f authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller

mptcp: use net instead of sock_net

Use the local variable 'net' instead of sock_net() in the functions where
the variable 'struct net *net' has been defined.
Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 109cdeb8
...@@ -1143,7 +1143,7 @@ void mptcp_pm_nl_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ss ...@@ -1143,7 +1143,7 @@ void mptcp_pm_nl_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ss
if (!tcp_rtx_and_write_queues_empty(ssk)) { if (!tcp_rtx_and_write_queues_empty(ssk)) {
subflow->stale = 1; subflow->stale = 1;
__mptcp_retransmit_pending_data(sk); __mptcp_retransmit_pending_data(sk);
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_SUBFLOWSTALE); MPTCP_INC_STATS(net, MPTCP_MIB_SUBFLOWSTALE);
} }
unlock_sock_fast(ssk, slow); unlock_sock_fast(ssk, slow);
...@@ -1903,8 +1903,7 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info) ...@@ -1903,8 +1903,7 @@ static int mptcp_nl_cmd_set_flags(struct sk_buff *skb, struct genl_info *info)
} }
if (token) if (token)
return mptcp_userspace_pm_set_flags(sock_net(skb->sk), return mptcp_userspace_pm_set_flags(net, token, &addr, &remote, bkup);
token, &addr, &remote, bkup);
spin_lock_bh(&pernet->lock); spin_lock_bh(&pernet->lock);
entry = __lookup_addr(pernet, &addr.addr, lookup_by_id); entry = __lookup_addr(pernet, &addr.addr, lookup_by_id);
......
...@@ -2723,8 +2723,8 @@ static int mptcp_init_sock(struct sock *sk) ...@@ -2723,8 +2723,8 @@ static int mptcp_init_sock(struct sock *sk)
mptcp_ca_reset(sk); mptcp_ca_reset(sk);
sk_sockets_allocated_inc(sk); sk_sockets_allocated_inc(sk);
sk->sk_rcvbuf = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[1]); sk->sk_rcvbuf = READ_ONCE(net->ipv4.sysctl_tcp_rmem[1]);
sk->sk_sndbuf = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[1]); sk->sk_sndbuf = READ_ONCE(net->ipv4.sysctl_tcp_wmem[1]);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment