aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/net.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-02-09 16:20:53 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-09 16:20:53 -0500
commit9dce285b70c157754d753203112cfef22770b1f9 (patch)
tree4859799a8311ecd637e2a582600af1057a78e08b /net/tipc/net.c
parentc8ac18f2006b2926ce375c01646b2f487d1c33b2 (diff)
parent941787b82982b3f33ac398c8c00035ddd0f8c514 (diff)
Merge branch 'tipc-next'
Richard Alpe says: ==================== tipc: new compat layer for the legacy NL API This is a compatibility / transcoding layer for the old netlink API. It relies on the new netlink API to collect data or perform actions (dumpit / doit). The main benefit of this compat layer is that it removes a lot of complex code from the tipc core as only the new API needs to be able harness data or perform actions. I.e. the compat layer isn't concerned with locking or how the internal data-structures look. As long as the new API stays relatively intact the compat layer should be fine. The main challenge in this compat layer is the randomness of the legacy API. Some commands send binary data and some send ASCII data, some are very picky in optimizing there buffer sizes and some just don't care. Most legacy commands put there data in a single TLV (data container) but some segment the data into multiple TLV's. This list of randomness goes on and on.. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r--net/tipc/net.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 263267e0e7fe..a54f3cbe2246 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -40,8 +40,6 @@
40#include "subscr.h" 40#include "subscr.h"
41#include "socket.h" 41#include "socket.h"
42#include "node.h" 42#include "node.h"
43#include "config.h"
44#include "bcast.h"
45 43
46static const struct nla_policy tipc_nl_net_policy[TIPC_NLA_NET_MAX + 1] = { 44static const struct nla_policy tipc_nl_net_policy[TIPC_NLA_NET_MAX + 1] = {
47 [TIPC_NLA_NET_UNSPEC] = { .type = NLA_UNSPEC }, 45 [TIPC_NLA_NET_UNSPEC] = { .type = NLA_UNSPEC },
@@ -156,7 +154,7 @@ static int __tipc_nl_add_net(struct net *net, struct tipc_nl_msg *msg)
156 void *hdr; 154 void *hdr;
157 struct nlattr *attrs; 155 struct nlattr *attrs;
158 156
159 hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_v2_family, 157 hdr = genlmsg_put(msg->skb, msg->portid, msg->seq, &tipc_genl_family,
160 NLM_F_MULTI, TIPC_NL_NET_GET); 158 NLM_F_MULTI, TIPC_NL_NET_GET);
161 if (!hdr) 159 if (!hdr)
162 return -EMSGSIZE; 160 return -EMSGSIZE;
@@ -208,7 +206,7 @@ out:
208 206
209int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) 207int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
210{ 208{
211 struct net *net = genl_info_net(info); 209 struct net *net = sock_net(skb->sk);
212 struct tipc_net *tn = net_generic(net, tipc_net_id); 210 struct tipc_net *tn = net_generic(net, tipc_net_id);
213 struct nlattr *attrs[TIPC_NLA_NET_MAX + 1]; 211 struct nlattr *attrs[TIPC_NLA_NET_MAX + 1];
214 int err; 212 int err;