aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/core.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/core.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/core.c')
-rw-r--r--net/tipc/core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c
index 674bd2698528..935205e6bcfe 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -39,7 +39,8 @@
39#include "core.h" 39#include "core.h"
40#include "name_table.h" 40#include "name_table.h"
41#include "subscr.h" 41#include "subscr.h"
42#include "config.h" 42#include "bearer.h"
43#include "net.h"
43#include "socket.h" 44#include "socket.h"
44 45
45#include <linux/module.h> 46#include <linux/module.h>
@@ -111,6 +112,10 @@ static int __init tipc_init(void)
111 if (err) 112 if (err)
112 goto out_netlink; 113 goto out_netlink;
113 114
115 err = tipc_netlink_compat_start();
116 if (err)
117 goto out_netlink_compat;
118
114 err = tipc_socket_init(); 119 err = tipc_socket_init();
115 if (err) 120 if (err)
116 goto out_socket; 121 goto out_socket;
@@ -136,6 +141,8 @@ out_pernet:
136out_sysctl: 141out_sysctl:
137 tipc_socket_stop(); 142 tipc_socket_stop();
138out_socket: 143out_socket:
144 tipc_netlink_compat_stop();
145out_netlink_compat:
139 tipc_netlink_stop(); 146 tipc_netlink_stop();
140out_netlink: 147out_netlink:
141 pr_err("Unable to start in single node mode\n"); 148 pr_err("Unable to start in single node mode\n");
@@ -146,6 +153,7 @@ static void __exit tipc_exit(void)
146{ 153{
147 tipc_bearer_cleanup(); 154 tipc_bearer_cleanup();
148 tipc_netlink_stop(); 155 tipc_netlink_stop();
156 tipc_netlink_compat_stop();
149 tipc_socket_stop(); 157 tipc_socket_stop();
150 tipc_unregister_sysctl(); 158 tipc_unregister_sysctl();
151 unregister_pernet_subsys(&tipc_net_ops); 159 unregister_pernet_subsys(&tipc_net_ops);