summaryrefslogtreecommitdiffstats
path: root/tipc
diff options
context:
space:
mode:
authorHoang Le <hoang.h.le@dektech.com.au>2018-06-08 09:19:28 +0700
committerStephen Hemminger <stephen@networkplumber.org>2018-06-08 10:07:13 -0700
commit313ce6949c0d08a9a04a891ab6d94d0916217c66 (patch)
tree8b2117533de3c41bfcc4a3b94e65168bafc6739f /tipc
parent974ef93bf127172d62a55cb21635138e2964c647 (diff)
tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINK
In the commit 94f6a80 on next-net, TIPC_NLA_LINK_NAME attribute should be retrieved and validated via TIPC_NLA_LINK nesting entry in tipc_nl_node_get_link(). According to that commit, TIPC_NLA_LINK_NAME value passing via tipc link get command must follow above hierachy. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'tipc')
-rw-r--r--tipc/link.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tipc/link.c b/tipc/link.c
index 02f14aad..a2d7c001 100644
--- a/tipc/link.c
+++ b/tipc/link.c
@@ -97,6 +97,7 @@ static int cmd_link_get_prop(struct nlmsghdr *nlh, const struct cmd *cmd,
{
int prop;
char buf[MNL_SOCKET_BUFFER_SIZE];
+ struct nlattr *attrs;
struct opt *opt;
struct opt opts[] = {
{ "link", OPT_KEYVAL, NULL },
@@ -131,7 +132,9 @@ static int cmd_link_get_prop(struct nlmsghdr *nlh, const struct cmd *cmd,
fprintf(stderr, "error, missing link\n");
return -EINVAL;
}
+ attrs = mnl_attr_nest_start(nlh, TIPC_NLA_LINK);
mnl_attr_put_strz(nlh, TIPC_NLA_LINK_NAME, opt->val);
+ mnl_attr_nest_end(nlh, attrs);
return msg_doit(nlh, link_get_cb, &prop);
}