mptcp: add mptcp_userspace_pm_get_sock helper
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 13 Dec 2024 19:52:54 +0000 (20:52 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sun, 15 Dec 2024 22:28:34 +0000 (14:28 -0800)
commit6a389c8ceeb75cf3c523ebf652a90958267c7b13
tree913f889f00a64eff4e65f36314ac92c486c2c3e1
parenta28717d8414e965a3ce6c83f744aa1c70ac8722f
mptcp: add mptcp_userspace_pm_get_sock helper

Each userspace pm netlink function uses nla_get_u32() to get the msk
token value, then pass it to mptcp_token_get_sock() to get the msk.
Finally check whether userspace PM is selected on this msk. It makes
sense to wrap them into a helper, named mptcp_userspace_pm_get_sock(),
to do this.

This patch doesn't change the behaviour of the code, just refactoring.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20241213-net-next-mptcp-pm-misc-cleanup-v1-3-ddb6d00109a8@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm_userspace.c