Commit 80638684 authored by Geliang Tang's avatar Geliang Tang Committed by Jakub Kicinski

mptcp: get sk from msk directly

Use '(struct sock *)msk' to get 'sk' from 'msk' in a more direct way
instead of using '&msk->sk.icsk_inet.sk'.
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 avatarJakub Kicinski <kuba@kernel.org>
parent 73a0052a
...@@ -291,7 +291,7 @@ int mptcp_nl_cmd_sf_create(struct sk_buff *skb, struct genl_info *info) ...@@ -291,7 +291,7 @@ int mptcp_nl_cmd_sf_create(struct sk_buff *skb, struct genl_info *info)
goto create_err; goto create_err;
} }
sk = &msk->sk.icsk_inet.sk; sk = (struct sock *)msk;
lock_sock(sk); lock_sock(sk);
err = __mptcp_subflow_connect(sk, &addr_l, &addr_r); err = __mptcp_subflow_connect(sk, &addr_l, &addr_r);
...@@ -403,7 +403,7 @@ int mptcp_nl_cmd_sf_destroy(struct sk_buff *skb, struct genl_info *info) ...@@ -403,7 +403,7 @@ int mptcp_nl_cmd_sf_destroy(struct sk_buff *skb, struct genl_info *info)
goto destroy_err; goto destroy_err;
} }
sk = &msk->sk.icsk_inet.sk; sk = (struct sock *)msk;
lock_sock(sk); lock_sock(sk);
ssk = mptcp_nl_find_ssk(msk, &addr_l, &addr_r); ssk = mptcp_nl_find_ssk(msk, &addr_l, &addr_r);
if (ssk) { if (ssk) {
......
...@@ -2454,7 +2454,7 @@ static bool mptcp_check_close_timeout(const struct sock *sk) ...@@ -2454,7 +2454,7 @@ static bool mptcp_check_close_timeout(const struct sock *sk)
static void mptcp_check_fastclose(struct mptcp_sock *msk) static void mptcp_check_fastclose(struct mptcp_sock *msk)
{ {
struct mptcp_subflow_context *subflow, *tmp; struct mptcp_subflow_context *subflow, *tmp;
struct sock *sk = &msk->sk.icsk_inet.sk; struct sock *sk = (struct sock *)msk;
if (likely(!READ_ONCE(msk->rcv_fastclose))) if (likely(!READ_ONCE(msk->rcv_fastclose)))
return; return;
...@@ -2616,7 +2616,7 @@ static void mptcp_do_fastclose(struct sock *sk) ...@@ -2616,7 +2616,7 @@ static void mptcp_do_fastclose(struct sock *sk)
static void mptcp_worker(struct work_struct *work) static void mptcp_worker(struct work_struct *work)
{ {
struct mptcp_sock *msk = container_of(work, struct mptcp_sock, work); struct mptcp_sock *msk = container_of(work, struct mptcp_sock, work);
struct sock *sk = &msk->sk.icsk_inet.sk; struct sock *sk = (struct sock *)msk;
unsigned long fail_tout; unsigned long fail_tout;
int state; int state;
......
...@@ -987,7 +987,7 @@ static int mptcp_getsockopt_tcpinfo(struct mptcp_sock *msk, char __user *optval, ...@@ -987,7 +987,7 @@ static int mptcp_getsockopt_tcpinfo(struct mptcp_sock *msk, char __user *optval,
int __user *optlen) int __user *optlen)
{ {
struct mptcp_subflow_context *subflow; struct mptcp_subflow_context *subflow;
struct sock *sk = &msk->sk.icsk_inet.sk; struct sock *sk = (struct sock *)msk;
unsigned int sfcount = 0, copied = 0; unsigned int sfcount = 0, copied = 0;
struct mptcp_subflow_data sfd; struct mptcp_subflow_data sfd;
char __user *infoptr; char __user *infoptr;
...@@ -1078,8 +1078,8 @@ static void mptcp_get_sub_addrs(const struct sock *sk, struct mptcp_subflow_addr ...@@ -1078,8 +1078,8 @@ static void mptcp_get_sub_addrs(const struct sock *sk, struct mptcp_subflow_addr
static int mptcp_getsockopt_subflow_addrs(struct mptcp_sock *msk, char __user *optval, static int mptcp_getsockopt_subflow_addrs(struct mptcp_sock *msk, char __user *optval,
int __user *optlen) int __user *optlen)
{ {
struct sock *sk = &msk->sk.icsk_inet.sk;
struct mptcp_subflow_context *subflow; struct mptcp_subflow_context *subflow;
struct sock *sk = (struct sock *)msk;
unsigned int sfcount = 0, copied = 0; unsigned int sfcount = 0, copied = 0;
struct mptcp_subflow_data sfd; struct mptcp_subflow_data sfd;
char __user *addrptr; char __user *addrptr;
......
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