Unverified Commit 93df4e1d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13086 MPTCP Upstream part 17

Merge Pull Request from: @geliangtang 
 
Patches from v6.9-rc1. 
 
Link:https://gitee.com/openeuler/kernel/pulls/13086

 

Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 829e5342 c2903379
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -290,13 +290,14 @@ operations:
    -
      name: get-addr
      doc: Get endpoint information
      attribute-set: endpoint
      attribute-set: attr
      dont-validate: [ strict ]
      flags: [ uns-admin-perm ]
      do: &get-addr-attrs
        request:
          attributes:
           - addr
           - token
        reply:
          attributes:
           - addr
+4 −3
Original line number Diff line number Diff line
@@ -32,8 +32,9 @@ const struct nla_policy mptcp_pm_del_addr_nl_policy[MPTCP_PM_ENDPOINT_ADDR + 1]
};

/* MPTCP_PM_CMD_GET_ADDR - do */
const struct nla_policy mptcp_pm_get_addr_nl_policy[MPTCP_PM_ENDPOINT_ADDR + 1] = {
	[MPTCP_PM_ENDPOINT_ADDR] = NLA_POLICY_NESTED(mptcp_pm_address_nl_policy),
const struct nla_policy mptcp_pm_get_addr_nl_policy[MPTCP_PM_ATTR_TOKEN + 1] = {
	[MPTCP_PM_ATTR_ADDR] = NLA_POLICY_NESTED(mptcp_pm_address_nl_policy),
	[MPTCP_PM_ATTR_TOKEN] = { .type = NLA_U32, },
};

/* MPTCP_PM_CMD_FLUSH_ADDRS - do */
@@ -110,7 +111,7 @@ const struct genl_ops mptcp_pm_nl_ops[11] = {
		.doit		= mptcp_pm_nl_get_addr_doit,
		.dumpit		= mptcp_pm_nl_get_addr_dumpit,
		.policy		= mptcp_pm_get_addr_nl_policy,
		.maxattr	= MPTCP_PM_ENDPOINT_ADDR,
		.maxattr	= MPTCP_PM_ATTR_TOKEN,
		.flags		= GENL_UNS_ADMIN_PERM,
	},
	{
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ extern const struct nla_policy mptcp_pm_add_addr_nl_policy[MPTCP_PM_ENDPOINT_ADD

extern const struct nla_policy mptcp_pm_del_addr_nl_policy[MPTCP_PM_ENDPOINT_ADDR + 1];

extern const struct nla_policy mptcp_pm_get_addr_nl_policy[MPTCP_PM_ENDPOINT_ADDR + 1];
extern const struct nla_policy mptcp_pm_get_addr_nl_policy[MPTCP_PM_ATTR_TOKEN + 1];

extern const struct nla_policy mptcp_pm_flush_addrs_nl_policy[MPTCP_PM_ENDPOINT_ADDR + 1];

+9 −0
Original line number Diff line number Diff line
@@ -430,6 +430,15 @@ 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_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
{
	const struct genl_info *info = genl_info_dump(cb);

	if (info->attrs[MPTCP_PM_ATTR_TOKEN])
		return mptcp_userspace_pm_dump_addr(msg, cb);
	return mptcp_pm_nl_dump_addr(msg, cb);
}

int mptcp_pm_set_flags(struct net *net, struct nlattr *token,
		       struct mptcp_pm_addr_entry *loc,
		       struct mptcp_pm_addr_entry *rem, u8 bkup)
+11 −8
Original line number Diff line number Diff line
@@ -18,9 +18,6 @@
#include "protocol.h"
#include "mib.h"

/* forward declaration */
static struct genl_family mptcp_genl_family;

static int pm_nl_pernet_id;

struct mptcp_pm_add_entry {
@@ -1757,7 +1754,7 @@ int mptcp_pm_nl_flush_addrs_doit(struct sk_buff *skb, struct genl_info *info)
	return 0;
}

static int mptcp_nl_fill_addr(struct sk_buff *skb,
int mptcp_nl_fill_addr(struct sk_buff *skb,
		       struct mptcp_pm_addr_entry *entry)
{
	struct mptcp_addr_info *addr = &entry->addr;
@@ -1846,7 +1843,7 @@ int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
	return ret;
}

int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
			  struct netlink_callback *cb)
{
	struct net *net = sock_net(msg->sk);
@@ -1889,6 +1886,12 @@ int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
	return msg->len;
}

int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
				struct netlink_callback *cb)
{
	return mptcp_pm_dump_addr(msg, cb);
}

static int parse_limit(struct genl_info *info, int id, unsigned int *limit)
{
	struct nlattr *attr = info->attrs[id];
@@ -2403,7 +2406,7 @@ void mptcp_event(enum mptcp_event_type type, const struct mptcp_sock *msk,
	nlmsg_free(skb);
}

static struct genl_family mptcp_genl_family __ro_after_init = {
struct genl_family mptcp_genl_family __ro_after_init = {
	.name		= MPTCP_PM_NAME,
	.version	= MPTCP_PM_VER,
	.netnsok	= true,
Loading