aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index baaf93f12cbd..f29549de9245 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1950,6 +1950,7 @@ out:
1950int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info) 1950int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info)
1951{ 1951{
1952 struct net *net = genl_info_net(info); 1952 struct net *net = genl_info_net(info);
1953 struct nlattr *attrs[TIPC_NLA_LINK_MAX + 1];
1953 struct tipc_nl_msg msg; 1954 struct tipc_nl_msg msg;
1954 char *name; 1955 char *name;
1955 int err; 1956 int err;
@@ -1957,9 +1958,19 @@ int tipc_nl_node_get_link(struct sk_buff *skb, struct genl_info *info)
1957 msg.portid = info->snd_portid; 1958 msg.portid = info->snd_portid;
1958 msg.seq = info->snd_seq; 1959 msg.seq = info->snd_seq;
1959 1960
1960 if (!info->attrs[TIPC_NLA_LINK_NAME]) 1961 if (!info->attrs[TIPC_NLA_LINK])
1961 return -EINVAL; 1962 return -EINVAL;
1962 name = nla_data(info->attrs[TIPC_NLA_LINK_NAME]); 1963
1964 err = nla_parse_nested(attrs, TIPC_NLA_LINK_MAX,
1965 info->attrs[TIPC_NLA_LINK],
1966 tipc_nl_link_policy, info->extack);
1967 if (err)
1968 return err;
1969
1970 if (!attrs[TIPC_NLA_LINK_NAME])
1971 return -EINVAL;
1972
1973 name = nla_data(attrs[TIPC_NLA_LINK_NAME]);
1963 1974
1964 msg.skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); 1975 msg.skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
1965 if (!msg.skb) 1976 if (!msg.skb)