diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-04-28 12:33:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-29 14:59:17 -0400 |
commit | f2f67390a4b961dae83733732e96e1a394a53c4e (patch) | |
tree | a8b85b41d7129cd8f36581384ff24e993e822a80 /net/tipc/link.c | |
parent | 46c264daaaa569e24f8aba877d0fd8167c42a9a4 (diff) |
tipc: remove wrong use of NLM_F_MULTI
NLM_F_MULTI must be used only when a NLMSG_DONE message is sent. In fact,
it is sent only at the end of a dump.
Libraries like libnl will wait forever for NLMSG_DONE.
Fixes: 35b9dd7607f0 ("tipc: add bearer get/dump to new netlink api")
Fixes: 7be57fc69184 ("tipc: add link get/dump to new netlink api")
Fixes: 46f15c6794fb ("tipc: add media get/dump to new netlink api")
CC: Richard Alpe <richard.alpe@ericsson.com>
CC: Jon Maloy <jon.maloy@ericsson.com>
CC: Ying Xue <ying.xue@windriver.com>
CC: tipc-discussion@lists.sourceforge.net
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 57be6e6aff99..a11cc5e5e0ae 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -2013,7 +2013,7 @@ msg_full: | |||
2013 | 2013 | ||
2014 | /* Caller should hold appropriate locks to protect the link */ | 2014 | /* Caller should hold appropriate locks to protect the link */ |
2015 | static int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg, | 2015 | static int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg, |
2016 | struct tipc_link *link) | 2016 | struct tipc_link *link, int nlflags) |
2017 | { | 2017 | { |
2018 | int err; | 2018 | int err; |
2019 | void *hdr; | 2019 | void *hdr; |
@@ -2022,7 +2022,7 @@ static int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg, | |||
2022 | struct tipc_net *tn = net_generic(net, tipc_net_id); | 2022 | struct tipc_net *tn = net_generic(net, tipc_net_id); |
2023 | 2023 | ||
2024 | hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, | 2024 | hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family, |
2025 | NLM_F_MULTI, TIPC_NL_LINK_GET); | 2025 | nlflags, TIPC_NL_LINK_GET); |
2026 | if (!hdr) | 2026 | if (!hdr) |
2027 | return -EMSGSIZE; | 2027 | return -EMSGSIZE; |
2028 | 2028 | ||
@@ -2095,7 +2095,7 @@ static int __tipc_nl_add_node_links(struct net *net, struct tipc_nl_msg *msg, | |||
2095 | if (!node->links[i]) | 2095 | if (!node->links[i]) |
2096 | continue; | 2096 | continue; |
2097 | 2097 | ||
2098 | err = __tipc_nl_add_link(net, msg, node->links[i]); | 2098 | err = __tipc_nl_add_link(net, msg, node->links[i], NLM_F_MULTI); |
2099 | if (err) | 2099 | if (err) |
2100 | return err; | 2100 | return err; |
2101 | } | 2101 | } |
@@ -2209,7 +2209,7 @@ int tipc_nl_link_get(struct sk_buff *skb, struct genl_info *info) | |||
2209 | goto err_out; | 2209 | goto err_out; |
2210 | } | 2210 | } |
2211 | 2211 | ||
2212 | err = __tipc_nl_add_link(net, &msg, link); | 2212 | err = __tipc_nl_add_link(net, &msg, link, 0); |
2213 | if (err) | 2213 | if (err) |
2214 | goto err_out; | 2214 | goto err_out; |
2215 | 2215 | ||