Commit cc84713a authored by Geliang Tang's avatar Geliang Tang
Browse files

mptcp: add token for get-addr in yaml

mainline inclusion
from mainline-v6.9-rc1
commit 9e6c88e2f05b05892113fc56fabc652ac1ee7043
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VYQ9
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=9e6c88e2f05b05892113fc56fabc652ac1ee7043



--------------------------------

This patch adds token parameter together with addr in get-addr section in
mptcp_pm.yaml, then use the following commands to update mptcp_pm_gen.c
and mptcp_pm_gen.h:

./tools/net/ynl/ynl-gen-c.py --mode kernel \
        --spec Documentation/netlink/specs/mptcp_pm.yaml --source \
        -o net/mptcp/mptcp_pm_gen.c
./tools/net/ynl/ynl-gen-c.py --mode kernel \
        --spec Documentation/netlink/specs/mptcp_pm.yaml --header \
        -o net/mptcp/mptcp_pm_gen.h

Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: default avatarMat Martineau <martineau@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Reviewed-by: default avatarJackie Liu <liuyun01@kylinos.cn>
Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
parent f4b7a71b
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];