]> www.infradead.org Git - users/dwmw2/linux.git/commit
mptcp: pm: use addr entry for get_local_id
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 7 Mar 2025 11:21:45 +0000 (12:21 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 10 Mar 2025 20:35:48 +0000 (13:35 -0700)
commit7462fe22cc74321eb663768848976d42eba3ddbb
tree1a5edbf2778091bff8c2e11d0494be173fd98b6d
parent991a1b09920bc15c66f64c1e7d15cdabd3816c46
mptcp: pm: use addr entry for get_local_id

The following code in mptcp_userspace_pm_get_local_id() that assigns "skc"
to "new_entry" is not allowed in BPF if we use the same code to implement
the get_local_id() interface of a BFP path manager:

memset(&new_entry, 0, sizeof(struct mptcp_pm_addr_entry));
new_entry.addr = *skc;
new_entry.addr.id = 0;
new_entry.flags = MPTCP_PM_ADDR_FLAG_IMPLICIT;

To solve the issue, this patch moves this assignment to "new_entry" forward
to mptcp_pm_get_local_id(), and then passing "new_entry" as a parameter to
both mptcp_pm_nl_get_local_id() and mptcp_userspace_pm_get_local_id().

No behavioural changes intended.

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/20250307-net-next-mptcp-pm-reorg-v1-1-abef20ada03b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/pm.c
net/mptcp/pm_netlink.c
net/mptcp/pm_userspace.c
net/mptcp/protocol.h