File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1950,16 +1950,27 @@ int tipc_nl_node_set_link(struct sk_buff *skb, struct genl_info *info)
1950
1950
int tipc_nl_node_get_link (struct sk_buff * skb , struct genl_info * info )
1951
1951
{
1952
1952
struct net * net = genl_info_net (info );
1953
+ struct nlattr * attrs [TIPC_NLA_LINK_MAX + 1 ];
1953
1954
struct tipc_nl_msg msg ;
1954
1955
char * name ;
1955
1956
int err ;
1956
1957
1957
1958
msg .portid = info -> snd_portid ;
1958
1959
msg .seq = info -> snd_seq ;
1959
1960
1960
- if (!info -> attrs [TIPC_NLA_LINK_NAME ])
1961
+ if (!info -> attrs [TIPC_NLA_LINK ])
1961
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
1975
msg .skb = nlmsg_new (NLMSG_GOODSIZE , GFP_KERNEL );
1965
1976
if (!msg .skb )
You can’t perform that action at this time.
0 commit comments