Skip to content

Commit ca6e55a

Browse files
matttbekuba-moo
authored andcommitted
mptcp: pm: only in-kernel cannot have entries with ID 0
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: f40be0d ("mptcp: unify pm get_flags_and_ifindex_by_id") Cc: [email protected] Acked-by: Geliang Tang <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0137a3c commit ca6e55a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

net/mptcp/pm.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,6 @@ int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id
434434
*flags = 0;
435435
*ifindex = 0;
436436

437-
if (!id)
438-
return 0;
439-
440437
if (mptcp_pm_is_userspace(msk))
441438
return mptcp_userspace_pm_get_flags_and_ifindex_by_id(msk, id, flags, ifindex);
442439
return mptcp_pm_nl_get_flags_and_ifindex_by_id(msk, id, flags, ifindex);

net/mptcp/pm_netlink.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,10 @@ int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int
13951395
struct sock *sk = (struct sock *)msk;
13961396
struct net *net = sock_net(sk);
13971397

1398+
/* No entries with ID 0 */
1399+
if (id == 0)
1400+
return 0;
1401+
13981402
rcu_read_lock();
13991403
entry = __lookup_addr_by_id(pm_nl_get_pernet(net), id);
14001404
if (entry) {

0 commit comments

Comments
 (0)