mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
mptcp: pm: only in-kernel cannot have entries with ID 0
commitca6e55a703
upstream. The ID 0 is specific per MPTCP connections. The per netns entries cannot have this special ID 0 then. But that's different for the userspace PM where the entries are per connection, they can then use this special ID 0. Fixes:f40be0db0b
("mptcp: unify pm get_flags_and_ifindex_by_id") Cc: stable@vger.kernel.org Acked-by: Geliang Tang <geliang@kernel.org> Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-11-38035d40de5b@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9907af6a28
commit
a7a692b791
|
@ -435,9 +435,6 @@ int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
*ifindex = 0;
|
*ifindex = 0;
|
||||||
|
|
||||||
if (!id)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (mptcp_pm_is_userspace(msk))
|
if (mptcp_pm_is_userspace(msk))
|
||||||
return mptcp_userspace_pm_get_flags_and_ifindex_by_id(msk, id, flags, ifindex);
|
return mptcp_userspace_pm_get_flags_and_ifindex_by_id(msk, id, flags, ifindex);
|
||||||
return mptcp_pm_nl_get_flags_and_ifindex_by_id(msk, id, flags, ifindex);
|
return mptcp_pm_nl_get_flags_and_ifindex_by_id(msk, id, flags, ifindex);
|
||||||
|
|
|
@ -1426,6 +1426,10 @@ int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int
|
||||||
struct sock *sk = (struct sock *)msk;
|
struct sock *sk = (struct sock *)msk;
|
||||||
struct net *net = sock_net(sk);
|
struct net *net = sock_net(sk);
|
||||||
|
|
||||||
|
/* No entries with ID 0 */
|
||||||
|
if (id == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
entry = __lookup_addr_by_id(pm_nl_get_pernet(net), id);
|
entry = __lookup_addr_by_id(pm_nl_get_pernet(net), id);
|
||||||
if (entry) {
|
if (entry) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user