diff options
| author | Geliang Tang <[email protected]> | 2024-03-01 18:18:37 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2024-03-04 13:07:46 +0000 |
| commit | 564ae6794ec5f050bb6df4446820777e7253f960 (patch) | |
| tree | f64cfc7c2bcf91d31140eff884f86ba737425304 /net/mptcp/pm.c | |
| parent | mptcp: implement mptcp_userspace_pm_get_addr (diff) | |
| download | kernel-564ae6794ec5f050bb6df4446820777e7253f960.tar.gz kernel-564ae6794ec5f050bb6df4446820777e7253f960.zip | |
mptcp: get addr in userspace pm list
This patch renames mptcp_pm_nl_get_addr_doit() as a dedicated in-kernel
netlink PM get addr function mptcp_pm_nl_get_addr(). and invoke a new
wrapper mptcp_pm_get_addr() in mptcp_pm_nl_get_addr_doit.
If a token is gotten in the wrapper, that means a userspace PM is used.
So invoke mptcp_userspace_pm_get_addr() to get addr in userspace PM list.
Otherwise, invoke mptcp_pm_nl_get_addr().
Signed-off-by: Geliang Tang <[email protected]>
Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/mptcp/pm.c')
| -rw-r--r-- | net/mptcp/pm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 193198cec74a..b4bdd92a5648 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -441,6 +441,13 @@ int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id return mptcp_pm_nl_get_flags_and_ifindex_by_id(msk, id, flags, ifindex); } +int mptcp_pm_get_addr(struct sk_buff *skb, struct genl_info *info) +{ + if (info->attrs[MPTCP_PM_ATTR_TOKEN]) + return mptcp_userspace_pm_get_addr(skb, info); + return mptcp_pm_nl_get_addr(skb, info); +} + int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb) { const struct genl_info *info = genl_info_dump(cb); |
