summaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 6f98b56dd48e..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)
@@ -2244,7 +2255,7 @@ int tipc_nl_node_dump_monitor(struct sk_buff *skb, struct netlink_callback *cb)
2244 2255
2245 rtnl_lock(); 2256 rtnl_lock();
2246 for (bearer_id = prev_bearer; bearer_id < MAX_BEARERS; bearer_id++) { 2257 for (bearer_id = prev_bearer; bearer_id < MAX_BEARERS; bearer_id++) {
2247 err = __tipc_nl_add_monitor(net, &msg, prev_bearer); 2258 err = __tipc_nl_add_monitor(net, &msg, bearer_id);
2248 if (err) 2259 if (err)
2249 break; 2260 break;
2250 } 2261 }