* [iproute2 1/1] tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINK
@ 2018-06-08 2:19 Hoang Le
2018-06-08 7:26 ` Jon Maloy
2018-06-08 17:07 ` Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: Hoang Le @ 2018-06-08 2:19 UTC (permalink / raw)
To: netdev, tipc-discussion, jon.maloy, maloy, ying.xue
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>
---
tipc/link.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tipc/link.c b/tipc/link.c
index 02f14aadefa6..a2d7c0016bc1 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);
}
--
2.1.4
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [iproute2 1/1] tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINK
2018-06-08 2:19 [iproute2 1/1] tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINK Hoang Le
@ 2018-06-08 7:26 ` Jon Maloy
2018-06-08 17:07 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Jon Maloy @ 2018-06-08 7:26 UTC (permalink / raw)
To: Hoang Huu Le, netdev@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, maloy@donjonn.com,
ying.xue@windriver.com
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> -----Original Message-----
> From: Hoang Le <hoang.h.le@dektech.com.au>
> Sent: Friday, 08 June, 2018 04:19
> To: netdev@vger.kernel.org; tipc-discussion@lists.sourceforge.net; Jon
> Maloy <jon.maloy@ericsson.com>; maloy@donjonn.com;
> ying.xue@windriver.com
> Subject: [iproute2 1/1] 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>
> ---
> tipc/link.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tipc/link.c b/tipc/link.c
> index 02f14aadefa6..a2d7c0016bc1 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); }
> --
> 2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [iproute2 1/1] tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINK
2018-06-08 2:19 [iproute2 1/1] tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINK Hoang Le
2018-06-08 7:26 ` Jon Maloy
@ 2018-06-08 17:07 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2018-06-08 17:07 UTC (permalink / raw)
To: Hoang Le; +Cc: netdev, tipc-discussion, jon.maloy, maloy, ying.xue
On Fri, 8 Jun 2018 09:19:28 +0700
Hoang Le <hoang.h.le@dektech.com.au> wrote:
> 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>
Applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-08 17:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-08 2:19 [iproute2 1/1] tipc: TIPC_NLA_LINK_NAME value pass on nesting entry TIPC_NLA_LINK Hoang Le
2018-06-08 7:26 ` Jon Maloy
2018-06-08 17:07 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).