config.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. /*
  2. * net/tipc/config.c: TIPC configuration management code
  3. *
  4. * Copyright (c) 2002-2006, Ericsson AB
  5. * Copyright (c) 2004-2007, Wind River Systems
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions are met:
  10. *
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. * 3. Neither the names of the copyright holders nor the names of its
  17. * contributors may be used to endorse or promote products derived from
  18. * this software without specific prior written permission.
  19. *
  20. * Alternatively, this software may be distributed under the terms of the
  21. * GNU General Public License ("GPL") version 2 as published by the Free
  22. * Software Foundation.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  28. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  29. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  30. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  31. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  32. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  33. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  34. * POSSIBILITY OF SUCH DAMAGE.
  35. */
  36. #include "core.h"
  37. #include "port.h"
  38. #include "link.h"
  39. #include "name_table.h"
  40. #include "config.h"
  41. static u32 config_port_ref;
  42. static DEFINE_SPINLOCK(config_lock);
  43. static const void *req_tlv_area; /* request message TLV area */
  44. static int req_tlv_space; /* request message TLV area size */
  45. static int rep_headroom; /* reply message headroom to use */
  46. struct sk_buff *tipc_cfg_reply_alloc(int payload_size)
  47. {
  48. struct sk_buff *buf;
  49. buf = alloc_skb(rep_headroom + payload_size, GFP_ATOMIC);
  50. if (buf)
  51. skb_reserve(buf, rep_headroom);
  52. return buf;
  53. }
  54. int tipc_cfg_append_tlv(struct sk_buff *buf, int tlv_type,
  55. void *tlv_data, int tlv_data_size)
  56. {
  57. struct tlv_desc *tlv = (struct tlv_desc *)skb_tail_pointer(buf);
  58. int new_tlv_space = TLV_SPACE(tlv_data_size);
  59. if (skb_tailroom(buf) < new_tlv_space) {
  60. dbg("tipc_cfg_append_tlv unable to append TLV\n");
  61. return 0;
  62. }
  63. skb_put(buf, new_tlv_space);
  64. tlv->tlv_type = htons(tlv_type);
  65. tlv->tlv_len = htons(TLV_LENGTH(tlv_data_size));
  66. if (tlv_data_size && tlv_data)
  67. memcpy(TLV_DATA(tlv), tlv_data, tlv_data_size);
  68. return 1;
  69. }
  70. static struct sk_buff *tipc_cfg_reply_unsigned_type(u16 tlv_type, u32 value)
  71. {
  72. struct sk_buff *buf;
  73. __be32 value_net;
  74. buf = tipc_cfg_reply_alloc(TLV_SPACE(sizeof(value)));
  75. if (buf) {
  76. value_net = htonl(value);
  77. tipc_cfg_append_tlv(buf, tlv_type, &value_net,
  78. sizeof(value_net));
  79. }
  80. return buf;
  81. }
  82. static struct sk_buff *tipc_cfg_reply_unsigned(u32 value)
  83. {
  84. return tipc_cfg_reply_unsigned_type(TIPC_TLV_UNSIGNED, value);
  85. }
  86. struct sk_buff *tipc_cfg_reply_string_type(u16 tlv_type, char *string)
  87. {
  88. struct sk_buff *buf;
  89. int string_len = strlen(string) + 1;
  90. buf = tipc_cfg_reply_alloc(TLV_SPACE(string_len));
  91. if (buf)
  92. tipc_cfg_append_tlv(buf, tlv_type, string, string_len);
  93. return buf;
  94. }
  95. #define MAX_STATS_INFO 2000
  96. static struct sk_buff *tipc_show_stats(void)
  97. {
  98. struct sk_buff *buf;
  99. struct tlv_desc *rep_tlv;
  100. struct print_buf pb;
  101. int str_len;
  102. u32 value;
  103. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
  104. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  105. value = ntohl(*(u32 *)TLV_DATA(req_tlv_area));
  106. if (value != 0)
  107. return tipc_cfg_reply_error_string("unsupported argument");
  108. buf = tipc_cfg_reply_alloc(TLV_SPACE(MAX_STATS_INFO));
  109. if (buf == NULL)
  110. return NULL;
  111. rep_tlv = (struct tlv_desc *)buf->data;
  112. tipc_printbuf_init(&pb, (char *)TLV_DATA(rep_tlv), MAX_STATS_INFO);
  113. tipc_printf(&pb, "TIPC version " TIPC_MOD_VER "\n");
  114. /* Use additional tipc_printf()'s to return more info ... */
  115. str_len = tipc_printbuf_validate(&pb);
  116. skb_put(buf, TLV_SPACE(str_len));
  117. TLV_SET(rep_tlv, TIPC_TLV_ULTRA_STRING, NULL, str_len);
  118. return buf;
  119. }
  120. static struct sk_buff *cfg_enable_bearer(void)
  121. {
  122. struct tipc_bearer_config *args;
  123. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_CONFIG))
  124. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  125. args = (struct tipc_bearer_config *)TLV_DATA(req_tlv_area);
  126. if (tipc_enable_bearer(args->name,
  127. ntohl(args->detect_scope),
  128. ntohl(args->priority)))
  129. return tipc_cfg_reply_error_string("unable to enable bearer");
  130. return tipc_cfg_reply_none();
  131. }
  132. static struct sk_buff *cfg_disable_bearer(void)
  133. {
  134. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_BEARER_NAME))
  135. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  136. if (tipc_disable_bearer((char *)TLV_DATA(req_tlv_area)))
  137. return tipc_cfg_reply_error_string("unable to disable bearer");
  138. return tipc_cfg_reply_none();
  139. }
  140. static struct sk_buff *cfg_set_own_addr(void)
  141. {
  142. u32 addr;
  143. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
  144. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  145. addr = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  146. if (addr == tipc_own_addr)
  147. return tipc_cfg_reply_none();
  148. if (!tipc_addr_node_valid(addr))
  149. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  150. " (node address)");
  151. if (tipc_mode == TIPC_NET_MODE)
  152. return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  153. " (cannot change node address once assigned)");
  154. /*
  155. * Must release all spinlocks before calling start_net() because
  156. * Linux version of TIPC calls eth_media_start() which calls
  157. * register_netdevice_notifier() which may block!
  158. *
  159. * Temporarily releasing the lock should be harmless for non-Linux TIPC,
  160. * but Linux version of eth_media_start() should really be reworked
  161. * so that it can be called with spinlocks held.
  162. */
  163. spin_unlock_bh(&config_lock);
  164. tipc_core_start_net(addr);
  165. spin_lock_bh(&config_lock);
  166. return tipc_cfg_reply_none();
  167. }
  168. static struct sk_buff *cfg_set_remote_mng(void)
  169. {
  170. u32 value;
  171. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
  172. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  173. value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  174. tipc_remote_management = (value != 0);
  175. return tipc_cfg_reply_none();
  176. }
  177. static struct sk_buff *cfg_set_max_publications(void)
  178. {
  179. u32 value;
  180. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
  181. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  182. value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  183. if (value != delimit(value, 1, 65535))
  184. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  185. " (max publications must be 1-65535)");
  186. tipc_max_publications = value;
  187. return tipc_cfg_reply_none();
  188. }
  189. static struct sk_buff *cfg_set_max_subscriptions(void)
  190. {
  191. u32 value;
  192. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
  193. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  194. value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  195. if (value != delimit(value, 1, 65535))
  196. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  197. " (max subscriptions must be 1-65535");
  198. tipc_max_subscriptions = value;
  199. return tipc_cfg_reply_none();
  200. }
  201. static struct sk_buff *cfg_set_max_ports(void)
  202. {
  203. u32 value;
  204. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
  205. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  206. value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  207. if (value == tipc_max_ports)
  208. return tipc_cfg_reply_none();
  209. if (value != delimit(value, 127, 65535))
  210. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  211. " (max ports must be 127-65535)");
  212. if (tipc_mode != TIPC_NOT_RUNNING)
  213. return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  214. " (cannot change max ports while TIPC is active)");
  215. tipc_max_ports = value;
  216. return tipc_cfg_reply_none();
  217. }
  218. static struct sk_buff *cfg_set_max_nodes(void)
  219. {
  220. u32 value;
  221. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
  222. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  223. value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  224. if (value == tipc_max_nodes)
  225. return tipc_cfg_reply_none();
  226. if (value != delimit(value, 8, 2047))
  227. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  228. " (max nodes must be 8-2047)");
  229. if (tipc_mode == TIPC_NET_MODE)
  230. return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  231. " (cannot change max nodes once TIPC has joined a network)");
  232. tipc_max_nodes = value;
  233. return tipc_cfg_reply_none();
  234. }
  235. static struct sk_buff *cfg_set_netid(void)
  236. {
  237. u32 value;
  238. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_UNSIGNED))
  239. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  240. value = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  241. if (value == tipc_net_id)
  242. return tipc_cfg_reply_none();
  243. if (value != delimit(value, 1, 9999))
  244. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  245. " (network id must be 1-9999)");
  246. if (tipc_mode == TIPC_NET_MODE)
  247. return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  248. " (cannot change network id once TIPC has joined a network)");
  249. tipc_net_id = value;
  250. return tipc_cfg_reply_none();
  251. }
  252. struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area,
  253. int request_space, int reply_headroom)
  254. {
  255. struct sk_buff *rep_tlv_buf;
  256. spin_lock_bh(&config_lock);
  257. /* Save request and reply details in a well-known location */
  258. req_tlv_area = request_area;
  259. req_tlv_space = request_space;
  260. rep_headroom = reply_headroom;
  261. /* Check command authorization */
  262. if (likely(orig_node == tipc_own_addr)) {
  263. /* command is permitted */
  264. } else if (cmd >= 0x8000) {
  265. rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  266. " (cannot be done remotely)");
  267. goto exit;
  268. } else if (!tipc_remote_management) {
  269. rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NO_REMOTE);
  270. goto exit;
  271. }
  272. else if (cmd >= 0x4000) {
  273. u32 domain = 0;
  274. if ((tipc_nametbl_translate(TIPC_ZM_SRV, 0, &domain) == 0) ||
  275. (domain != orig_node)) {
  276. rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_ZONE_MSTR);
  277. goto exit;
  278. }
  279. }
  280. /* Call appropriate processing routine */
  281. switch (cmd) {
  282. case TIPC_CMD_NOOP:
  283. rep_tlv_buf = tipc_cfg_reply_none();
  284. break;
  285. case TIPC_CMD_GET_NODES:
  286. rep_tlv_buf = tipc_node_get_nodes(req_tlv_area, req_tlv_space);
  287. break;
  288. case TIPC_CMD_GET_LINKS:
  289. rep_tlv_buf = tipc_node_get_links(req_tlv_area, req_tlv_space);
  290. break;
  291. case TIPC_CMD_SHOW_LINK_STATS:
  292. rep_tlv_buf = tipc_link_cmd_show_stats(req_tlv_area, req_tlv_space);
  293. break;
  294. case TIPC_CMD_RESET_LINK_STATS:
  295. rep_tlv_buf = tipc_link_cmd_reset_stats(req_tlv_area, req_tlv_space);
  296. break;
  297. case TIPC_CMD_SHOW_NAME_TABLE:
  298. rep_tlv_buf = tipc_nametbl_get(req_tlv_area, req_tlv_space);
  299. break;
  300. case TIPC_CMD_GET_BEARER_NAMES:
  301. rep_tlv_buf = tipc_bearer_get_names();
  302. break;
  303. case TIPC_CMD_GET_MEDIA_NAMES:
  304. rep_tlv_buf = tipc_media_get_names();
  305. break;
  306. case TIPC_CMD_SHOW_PORTS:
  307. rep_tlv_buf = tipc_port_get_ports();
  308. break;
  309. case TIPC_CMD_SET_LOG_SIZE:
  310. rep_tlv_buf = tipc_log_resize_cmd(req_tlv_area, req_tlv_space);
  311. break;
  312. case TIPC_CMD_DUMP_LOG:
  313. rep_tlv_buf = tipc_log_dump();
  314. break;
  315. case TIPC_CMD_SHOW_STATS:
  316. rep_tlv_buf = tipc_show_stats();
  317. break;
  318. case TIPC_CMD_SET_LINK_TOL:
  319. case TIPC_CMD_SET_LINK_PRI:
  320. case TIPC_CMD_SET_LINK_WINDOW:
  321. rep_tlv_buf = tipc_link_cmd_config(req_tlv_area, req_tlv_space, cmd);
  322. break;
  323. case TIPC_CMD_ENABLE_BEARER:
  324. rep_tlv_buf = cfg_enable_bearer();
  325. break;
  326. case TIPC_CMD_DISABLE_BEARER:
  327. rep_tlv_buf = cfg_disable_bearer();
  328. break;
  329. case TIPC_CMD_SET_NODE_ADDR:
  330. rep_tlv_buf = cfg_set_own_addr();
  331. break;
  332. case TIPC_CMD_SET_REMOTE_MNG:
  333. rep_tlv_buf = cfg_set_remote_mng();
  334. break;
  335. case TIPC_CMD_SET_MAX_PORTS:
  336. rep_tlv_buf = cfg_set_max_ports();
  337. break;
  338. case TIPC_CMD_SET_MAX_PUBL:
  339. rep_tlv_buf = cfg_set_max_publications();
  340. break;
  341. case TIPC_CMD_SET_MAX_SUBSCR:
  342. rep_tlv_buf = cfg_set_max_subscriptions();
  343. break;
  344. case TIPC_CMD_SET_MAX_NODES:
  345. rep_tlv_buf = cfg_set_max_nodes();
  346. break;
  347. case TIPC_CMD_SET_NETID:
  348. rep_tlv_buf = cfg_set_netid();
  349. break;
  350. case TIPC_CMD_GET_REMOTE_MNG:
  351. rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_remote_management);
  352. break;
  353. case TIPC_CMD_GET_MAX_PORTS:
  354. rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_ports);
  355. break;
  356. case TIPC_CMD_GET_MAX_PUBL:
  357. rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_publications);
  358. break;
  359. case TIPC_CMD_GET_MAX_SUBSCR:
  360. rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_subscriptions);
  361. break;
  362. case TIPC_CMD_GET_MAX_NODES:
  363. rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_max_nodes);
  364. break;
  365. case TIPC_CMD_GET_NETID:
  366. rep_tlv_buf = tipc_cfg_reply_unsigned(tipc_net_id);
  367. break;
  368. case TIPC_CMD_NOT_NET_ADMIN:
  369. rep_tlv_buf =
  370. tipc_cfg_reply_error_string(TIPC_CFG_NOT_NET_ADMIN);
  371. break;
  372. case TIPC_CMD_SET_MAX_ZONES:
  373. case TIPC_CMD_GET_MAX_ZONES:
  374. case TIPC_CMD_SET_MAX_SLAVES:
  375. case TIPC_CMD_GET_MAX_SLAVES:
  376. case TIPC_CMD_SET_MAX_CLUSTERS:
  377. case TIPC_CMD_GET_MAX_CLUSTERS:
  378. rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  379. " (obsolete command)");
  380. break;
  381. default:
  382. rep_tlv_buf = tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  383. " (unknown command)");
  384. break;
  385. }
  386. /* Return reply buffer */
  387. exit:
  388. spin_unlock_bh(&config_lock);
  389. return rep_tlv_buf;
  390. }
  391. static void cfg_named_msg_event(void *userdata,
  392. u32 port_ref,
  393. struct sk_buff **buf,
  394. const unchar *msg,
  395. u32 size,
  396. u32 importance,
  397. struct tipc_portid const *orig,
  398. struct tipc_name_seq const *dest)
  399. {
  400. struct tipc_cfg_msg_hdr *req_hdr;
  401. struct tipc_cfg_msg_hdr *rep_hdr;
  402. struct sk_buff *rep_buf;
  403. /* Validate configuration message header (ignore invalid message) */
  404. req_hdr = (struct tipc_cfg_msg_hdr *)msg;
  405. if ((size < sizeof(*req_hdr)) ||
  406. (size != TCM_ALIGN(ntohl(req_hdr->tcm_len))) ||
  407. (ntohs(req_hdr->tcm_flags) != TCM_F_REQUEST)) {
  408. warn("Invalid configuration message discarded\n");
  409. return;
  410. }
  411. /* Generate reply for request (if can't, return request) */
  412. rep_buf = tipc_cfg_do_cmd(orig->node,
  413. ntohs(req_hdr->tcm_type),
  414. msg + sizeof(*req_hdr),
  415. size - sizeof(*req_hdr),
  416. BUF_HEADROOM + MAX_H_SIZE + sizeof(*rep_hdr));
  417. if (rep_buf) {
  418. skb_push(rep_buf, sizeof(*rep_hdr));
  419. rep_hdr = (struct tipc_cfg_msg_hdr *)rep_buf->data;
  420. memcpy(rep_hdr, req_hdr, sizeof(*rep_hdr));
  421. rep_hdr->tcm_len = htonl(rep_buf->len);
  422. rep_hdr->tcm_flags &= htons(~TCM_F_REQUEST);
  423. } else {
  424. rep_buf = *buf;
  425. *buf = NULL;
  426. }
  427. /* NEED TO ADD CODE TO HANDLE FAILED SEND (SUCH AS CONGESTION) */
  428. tipc_send_buf2port(port_ref, orig, rep_buf, rep_buf->len);
  429. }
  430. int tipc_cfg_init(void)
  431. {
  432. struct tipc_name_seq seq;
  433. int res;
  434. res = tipc_createport(0, NULL, TIPC_CRITICAL_IMPORTANCE,
  435. NULL, NULL, NULL,
  436. NULL, cfg_named_msg_event, NULL,
  437. NULL, &config_port_ref);
  438. if (res)
  439. goto failed;
  440. seq.type = TIPC_CFG_SRV;
  441. seq.lower = seq.upper = tipc_own_addr;
  442. res = tipc_nametbl_publish_rsv(config_port_ref, TIPC_ZONE_SCOPE, &seq);
  443. if (res)
  444. goto failed;
  445. return 0;
  446. failed:
  447. err("Unable to create configuration service\n");
  448. return res;
  449. }
  450. void tipc_cfg_stop(void)
  451. {
  452. if (config_port_ref) {
  453. tipc_deleteport(config_port_ref);
  454. config_port_ref = 0;
  455. }
  456. }