@@ -447,13 +447,14 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)
bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
{
struct mptcp_addr_info skc_local;
+ struct mptcp_pm_param param;
mptcp_local_address((struct sock_common *)skc, &skc_local);
- if (mptcp_pm_is_userspace(msk))
- return mptcp_userspace_pm_is_backup(msk, &skc_local);
-
- return mptcp_pm_nl_is_backup(msk, &skc_local);
+ if (!msk->pm.ops || !msk->pm.ops->get_priority)
+ return -ENOTSUPP;
+ mptcp_pm_param_set_contexts(¶m, NULL, &skc_local);
+ return msk->pm.ops->get_priority(msk, ¶m);
}
static int mptcp_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
@@ -1188,14 +1188,6 @@ static bool mptcp_pm_nl_get_priority(struct mptcp_sock *msk,
return backup;
}
-bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc)
-{
- struct mptcp_pm_param param;
-
- mptcp_pm_param_set_contexts(¶m, NULL, skc);
- return mptcp_pm_nl_get_priority(msk, ¶m);
-}
-
#define MPTCP_PM_CMD_GRP_OFFSET 0
#define MPTCP_PM_EV_GRP_OFFSET 1
@@ -165,15 +165,6 @@ static bool mptcp_userspace_pm_get_priority(struct mptcp_sock *msk,
return backup;
}
-bool mptcp_userspace_pm_is_backup(struct mptcp_sock *msk,
- struct mptcp_addr_info *skc)
-{
- struct mptcp_pm_param param;
-
- mptcp_pm_param_set_contexts(¶m, NULL, skc);
- return mptcp_userspace_pm_get_priority(msk, ¶m);
-}
-
static struct mptcp_sock *mptcp_userspace_pm_get_sock(const struct genl_info *info)
{
struct mptcp_sock *msk;
@@ -1130,8 +1130,6 @@ void mptcp_pm_param_set_contexts(struct mptcp_pm_param *param,
const struct mptcp_addr_info *addr);
int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc);
bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc);
-bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
-bool mptcp_userspace_pm_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc);
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,