node.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * net/tipc/node.c: TIPC node management routines
  3. *
  4. * Copyright (c) 2000-2006, 2012-2014, Ericsson AB
  5. * Copyright (c) 2005-2006, 2010-2014, 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 "config.h"
  38. #include "node.h"
  39. #include "name_distr.h"
  40. #include "socket.h"
  41. #define NODE_HTABLE_SIZE 512
  42. static void node_lost_contact(struct tipc_node *n_ptr);
  43. static void node_established_contact(struct tipc_node *n_ptr);
  44. static struct hlist_head node_htable[NODE_HTABLE_SIZE];
  45. LIST_HEAD(tipc_node_list);
  46. static u32 tipc_num_nodes;
  47. static u32 tipc_num_links;
  48. static DEFINE_SPINLOCK(node_list_lock);
  49. struct tipc_sock_conn {
  50. u32 port;
  51. u32 peer_port;
  52. u32 peer_node;
  53. struct list_head list;
  54. };
  55. /*
  56. * A trivial power-of-two bitmask technique is used for speed, since this
  57. * operation is done for every incoming TIPC packet. The number of hash table
  58. * entries has been chosen so that no hash chain exceeds 8 nodes and will
  59. * usually be much smaller (typically only a single node).
  60. */
  61. static unsigned int tipc_hashfn(u32 addr)
  62. {
  63. return addr & (NODE_HTABLE_SIZE - 1);
  64. }
  65. /*
  66. * tipc_node_find - locate specified node object, if it exists
  67. */
  68. struct tipc_node *tipc_node_find(u32 addr)
  69. {
  70. struct tipc_node *node;
  71. if (unlikely(!in_own_cluster_exact(addr)))
  72. return NULL;
  73. rcu_read_lock();
  74. hlist_for_each_entry_rcu(node, &node_htable[tipc_hashfn(addr)], hash) {
  75. if (node->addr == addr) {
  76. rcu_read_unlock();
  77. return node;
  78. }
  79. }
  80. rcu_read_unlock();
  81. return NULL;
  82. }
  83. struct tipc_node *tipc_node_create(u32 addr)
  84. {
  85. struct tipc_node *n_ptr, *temp_node;
  86. spin_lock_bh(&node_list_lock);
  87. n_ptr = kzalloc(sizeof(*n_ptr), GFP_ATOMIC);
  88. if (!n_ptr) {
  89. spin_unlock_bh(&node_list_lock);
  90. pr_warn("Node creation failed, no memory\n");
  91. return NULL;
  92. }
  93. n_ptr->addr = addr;
  94. spin_lock_init(&n_ptr->lock);
  95. INIT_HLIST_NODE(&n_ptr->hash);
  96. INIT_LIST_HEAD(&n_ptr->list);
  97. INIT_LIST_HEAD(&n_ptr->nsub);
  98. INIT_LIST_HEAD(&n_ptr->conn_sks);
  99. __skb_queue_head_init(&n_ptr->waiting_sks);
  100. hlist_add_head_rcu(&n_ptr->hash, &node_htable[tipc_hashfn(addr)]);
  101. list_for_each_entry_rcu(temp_node, &tipc_node_list, list) {
  102. if (n_ptr->addr < temp_node->addr)
  103. break;
  104. }
  105. list_add_tail_rcu(&n_ptr->list, &temp_node->list);
  106. n_ptr->action_flags = TIPC_WAIT_PEER_LINKS_DOWN;
  107. n_ptr->signature = INVALID_NODE_SIG;
  108. tipc_num_nodes++;
  109. spin_unlock_bh(&node_list_lock);
  110. return n_ptr;
  111. }
  112. static void tipc_node_delete(struct tipc_node *n_ptr)
  113. {
  114. list_del_rcu(&n_ptr->list);
  115. hlist_del_rcu(&n_ptr->hash);
  116. kfree_rcu(n_ptr, rcu);
  117. tipc_num_nodes--;
  118. }
  119. void tipc_node_stop(void)
  120. {
  121. struct tipc_node *node, *t_node;
  122. spin_lock_bh(&node_list_lock);
  123. list_for_each_entry_safe(node, t_node, &tipc_node_list, list)
  124. tipc_node_delete(node);
  125. spin_unlock_bh(&node_list_lock);
  126. }
  127. int tipc_node_add_conn(u32 dnode, u32 port, u32 peer_port)
  128. {
  129. struct tipc_node *node;
  130. struct tipc_sock_conn *conn;
  131. if (in_own_node(dnode))
  132. return 0;
  133. node = tipc_node_find(dnode);
  134. if (!node) {
  135. pr_warn("Connecting sock to node 0x%x failed\n", dnode);
  136. return -EHOSTUNREACH;
  137. }
  138. conn = kmalloc(sizeof(*conn), GFP_ATOMIC);
  139. if (!conn)
  140. return -EHOSTUNREACH;
  141. conn->peer_node = dnode;
  142. conn->port = port;
  143. conn->peer_port = peer_port;
  144. tipc_node_lock(node);
  145. list_add_tail(&conn->list, &node->conn_sks);
  146. tipc_node_unlock(node);
  147. return 0;
  148. }
  149. void tipc_node_remove_conn(u32 dnode, u32 port)
  150. {
  151. struct tipc_node *node;
  152. struct tipc_sock_conn *conn, *safe;
  153. if (in_own_node(dnode))
  154. return;
  155. node = tipc_node_find(dnode);
  156. if (!node)
  157. return;
  158. tipc_node_lock(node);
  159. list_for_each_entry_safe(conn, safe, &node->conn_sks, list) {
  160. if (port != conn->port)
  161. continue;
  162. list_del(&conn->list);
  163. kfree(conn);
  164. }
  165. tipc_node_unlock(node);
  166. }
  167. void tipc_node_abort_sock_conns(struct list_head *conns)
  168. {
  169. struct tipc_sock_conn *conn, *safe;
  170. struct sk_buff *buf;
  171. list_for_each_entry_safe(conn, safe, conns, list) {
  172. buf = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, TIPC_CONN_MSG,
  173. SHORT_H_SIZE, 0, tipc_own_addr,
  174. conn->peer_node, conn->port,
  175. conn->peer_port, TIPC_ERR_NO_NODE);
  176. if (likely(buf))
  177. tipc_sk_rcv(buf);
  178. list_del(&conn->list);
  179. kfree(conn);
  180. }
  181. }
  182. /**
  183. * tipc_node_link_up - handle addition of link
  184. *
  185. * Link becomes active (alone or shared) or standby, depending on its priority.
  186. */
  187. void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
  188. {
  189. struct tipc_link **active = &n_ptr->active_links[0];
  190. n_ptr->working_links++;
  191. n_ptr->action_flags |= TIPC_NOTIFY_LINK_UP;
  192. n_ptr->link_id = l_ptr->peer_bearer_id << 16 | l_ptr->bearer_id;
  193. pr_info("Established link <%s> on network plane %c\n",
  194. l_ptr->name, l_ptr->net_plane);
  195. if (!active[0]) {
  196. active[0] = active[1] = l_ptr;
  197. node_established_contact(n_ptr);
  198. goto exit;
  199. }
  200. if (l_ptr->priority < active[0]->priority) {
  201. pr_info("New link <%s> becomes standby\n", l_ptr->name);
  202. goto exit;
  203. }
  204. tipc_link_dup_queue_xmit(active[0], l_ptr);
  205. if (l_ptr->priority == active[0]->priority) {
  206. active[0] = l_ptr;
  207. goto exit;
  208. }
  209. pr_info("Old link <%s> becomes standby\n", active[0]->name);
  210. if (active[1] != active[0])
  211. pr_info("Old link <%s> becomes standby\n", active[1]->name);
  212. active[0] = active[1] = l_ptr;
  213. exit:
  214. /* Leave room for changeover header when returning 'mtu' to users: */
  215. n_ptr->act_mtus[0] = active[0]->max_pkt - INT_H_SIZE;
  216. n_ptr->act_mtus[1] = active[1]->max_pkt - INT_H_SIZE;
  217. }
  218. /**
  219. * node_select_active_links - select active link
  220. */
  221. static void node_select_active_links(struct tipc_node *n_ptr)
  222. {
  223. struct tipc_link **active = &n_ptr->active_links[0];
  224. u32 i;
  225. u32 highest_prio = 0;
  226. active[0] = active[1] = NULL;
  227. for (i = 0; i < MAX_BEARERS; i++) {
  228. struct tipc_link *l_ptr = n_ptr->links[i];
  229. if (!l_ptr || !tipc_link_is_up(l_ptr) ||
  230. (l_ptr->priority < highest_prio))
  231. continue;
  232. if (l_ptr->priority > highest_prio) {
  233. highest_prio = l_ptr->priority;
  234. active[0] = active[1] = l_ptr;
  235. } else {
  236. active[1] = l_ptr;
  237. }
  238. }
  239. }
  240. /**
  241. * tipc_node_link_down - handle loss of link
  242. */
  243. void tipc_node_link_down(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
  244. {
  245. struct tipc_link **active;
  246. n_ptr->working_links--;
  247. n_ptr->action_flags |= TIPC_NOTIFY_LINK_DOWN;
  248. n_ptr->link_id = l_ptr->peer_bearer_id << 16 | l_ptr->bearer_id;
  249. if (!tipc_link_is_active(l_ptr)) {
  250. pr_info("Lost standby link <%s> on network plane %c\n",
  251. l_ptr->name, l_ptr->net_plane);
  252. return;
  253. }
  254. pr_info("Lost link <%s> on network plane %c\n",
  255. l_ptr->name, l_ptr->net_plane);
  256. active = &n_ptr->active_links[0];
  257. if (active[0] == l_ptr)
  258. active[0] = active[1];
  259. if (active[1] == l_ptr)
  260. active[1] = active[0];
  261. if (active[0] == l_ptr)
  262. node_select_active_links(n_ptr);
  263. if (tipc_node_is_up(n_ptr))
  264. tipc_link_failover_send_queue(l_ptr);
  265. else
  266. node_lost_contact(n_ptr);
  267. /* Leave room for changeover header when returning 'mtu' to users: */
  268. if (active[0]) {
  269. n_ptr->act_mtus[0] = active[0]->max_pkt - INT_H_SIZE;
  270. n_ptr->act_mtus[1] = active[1]->max_pkt - INT_H_SIZE;
  271. return;
  272. }
  273. /* Loopback link went down? No fragmentation needed from now on. */
  274. if (n_ptr->addr == tipc_own_addr) {
  275. n_ptr->act_mtus[0] = MAX_MSG_SIZE;
  276. n_ptr->act_mtus[1] = MAX_MSG_SIZE;
  277. }
  278. }
  279. int tipc_node_active_links(struct tipc_node *n_ptr)
  280. {
  281. return n_ptr->active_links[0] != NULL;
  282. }
  283. int tipc_node_is_up(struct tipc_node *n_ptr)
  284. {
  285. return tipc_node_active_links(n_ptr);
  286. }
  287. void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
  288. {
  289. n_ptr->links[l_ptr->bearer_id] = l_ptr;
  290. spin_lock_bh(&node_list_lock);
  291. tipc_num_links++;
  292. spin_unlock_bh(&node_list_lock);
  293. n_ptr->link_cnt++;
  294. }
  295. void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
  296. {
  297. int i;
  298. for (i = 0; i < MAX_BEARERS; i++) {
  299. if (l_ptr != n_ptr->links[i])
  300. continue;
  301. n_ptr->links[i] = NULL;
  302. spin_lock_bh(&node_list_lock);
  303. tipc_num_links--;
  304. spin_unlock_bh(&node_list_lock);
  305. n_ptr->link_cnt--;
  306. }
  307. }
  308. static void node_established_contact(struct tipc_node *n_ptr)
  309. {
  310. n_ptr->action_flags |= TIPC_NOTIFY_NODE_UP;
  311. n_ptr->bclink.oos_state = 0;
  312. n_ptr->bclink.acked = tipc_bclink_get_last_sent();
  313. tipc_bclink_add_node(n_ptr->addr);
  314. }
  315. static void node_lost_contact(struct tipc_node *n_ptr)
  316. {
  317. char addr_string[16];
  318. u32 i;
  319. pr_info("Lost contact with %s\n",
  320. tipc_addr_string_fill(addr_string, n_ptr->addr));
  321. /* Flush broadcast link info associated with lost node */
  322. if (n_ptr->bclink.recv_permitted) {
  323. kfree_skb_list(n_ptr->bclink.deferred_head);
  324. n_ptr->bclink.deferred_size = 0;
  325. if (n_ptr->bclink.reasm_buf) {
  326. kfree_skb(n_ptr->bclink.reasm_buf);
  327. n_ptr->bclink.reasm_buf = NULL;
  328. }
  329. tipc_bclink_remove_node(n_ptr->addr);
  330. tipc_bclink_acknowledge(n_ptr, INVALID_LINK_SEQ);
  331. n_ptr->bclink.recv_permitted = false;
  332. }
  333. /* Abort link changeover */
  334. for (i = 0; i < MAX_BEARERS; i++) {
  335. struct tipc_link *l_ptr = n_ptr->links[i];
  336. if (!l_ptr)
  337. continue;
  338. l_ptr->reset_checkpoint = l_ptr->next_in_no;
  339. l_ptr->exp_msg_count = 0;
  340. tipc_link_reset_fragments(l_ptr);
  341. }
  342. n_ptr->action_flags &= ~TIPC_WAIT_OWN_LINKS_DOWN;
  343. /* Notify subscribers and prevent re-contact with node until
  344. * cleanup is done.
  345. */
  346. n_ptr->action_flags |= TIPC_WAIT_PEER_LINKS_DOWN |
  347. TIPC_NOTIFY_NODE_DOWN;
  348. }
  349. struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
  350. {
  351. u32 domain;
  352. struct sk_buff *buf;
  353. struct tipc_node *n_ptr;
  354. struct tipc_node_info node_info;
  355. u32 payload_size;
  356. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
  357. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  358. domain = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  359. if (!tipc_addr_domain_valid(domain))
  360. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  361. " (network address)");
  362. spin_lock_bh(&node_list_lock);
  363. if (!tipc_num_nodes) {
  364. spin_unlock_bh(&node_list_lock);
  365. return tipc_cfg_reply_none();
  366. }
  367. /* For now, get space for all other nodes */
  368. payload_size = TLV_SPACE(sizeof(node_info)) * tipc_num_nodes;
  369. if (payload_size > 32768u) {
  370. spin_unlock_bh(&node_list_lock);
  371. return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  372. " (too many nodes)");
  373. }
  374. spin_unlock_bh(&node_list_lock);
  375. buf = tipc_cfg_reply_alloc(payload_size);
  376. if (!buf)
  377. return NULL;
  378. /* Add TLVs for all nodes in scope */
  379. rcu_read_lock();
  380. list_for_each_entry_rcu(n_ptr, &tipc_node_list, list) {
  381. if (!tipc_in_scope(domain, n_ptr->addr))
  382. continue;
  383. node_info.addr = htonl(n_ptr->addr);
  384. node_info.up = htonl(tipc_node_is_up(n_ptr));
  385. tipc_cfg_append_tlv(buf, TIPC_TLV_NODE_INFO,
  386. &node_info, sizeof(node_info));
  387. }
  388. rcu_read_unlock();
  389. return buf;
  390. }
  391. struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
  392. {
  393. u32 domain;
  394. struct sk_buff *buf;
  395. struct tipc_node *n_ptr;
  396. struct tipc_link_info link_info;
  397. u32 payload_size;
  398. if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR))
  399. return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR);
  400. domain = ntohl(*(__be32 *)TLV_DATA(req_tlv_area));
  401. if (!tipc_addr_domain_valid(domain))
  402. return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE
  403. " (network address)");
  404. if (!tipc_own_addr)
  405. return tipc_cfg_reply_none();
  406. spin_lock_bh(&node_list_lock);
  407. /* Get space for all unicast links + broadcast link */
  408. payload_size = TLV_SPACE((sizeof(link_info)) * (tipc_num_links + 1));
  409. if (payload_size > 32768u) {
  410. spin_unlock_bh(&node_list_lock);
  411. return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
  412. " (too many links)");
  413. }
  414. spin_unlock_bh(&node_list_lock);
  415. buf = tipc_cfg_reply_alloc(payload_size);
  416. if (!buf)
  417. return NULL;
  418. /* Add TLV for broadcast link */
  419. link_info.dest = htonl(tipc_cluster_mask(tipc_own_addr));
  420. link_info.up = htonl(1);
  421. strlcpy(link_info.str, tipc_bclink_name, TIPC_MAX_LINK_NAME);
  422. tipc_cfg_append_tlv(buf, TIPC_TLV_LINK_INFO, &link_info, sizeof(link_info));
  423. /* Add TLVs for any other links in scope */
  424. rcu_read_lock();
  425. list_for_each_entry_rcu(n_ptr, &tipc_node_list, list) {
  426. u32 i;
  427. if (!tipc_in_scope(domain, n_ptr->addr))
  428. continue;
  429. tipc_node_lock(n_ptr);
  430. for (i = 0; i < MAX_BEARERS; i++) {
  431. if (!n_ptr->links[i])
  432. continue;
  433. link_info.dest = htonl(n_ptr->addr);
  434. link_info.up = htonl(tipc_link_is_up(n_ptr->links[i]));
  435. strcpy(link_info.str, n_ptr->links[i]->name);
  436. tipc_cfg_append_tlv(buf, TIPC_TLV_LINK_INFO,
  437. &link_info, sizeof(link_info));
  438. }
  439. tipc_node_unlock(n_ptr);
  440. }
  441. rcu_read_unlock();
  442. return buf;
  443. }
  444. /**
  445. * tipc_node_get_linkname - get the name of a link
  446. *
  447. * @bearer_id: id of the bearer
  448. * @node: peer node address
  449. * @linkname: link name output buffer
  450. *
  451. * Returns 0 on success
  452. */
  453. int tipc_node_get_linkname(u32 bearer_id, u32 addr, char *linkname, size_t len)
  454. {
  455. struct tipc_link *link;
  456. struct tipc_node *node = tipc_node_find(addr);
  457. if ((bearer_id >= MAX_BEARERS) || !node)
  458. return -EINVAL;
  459. tipc_node_lock(node);
  460. link = node->links[bearer_id];
  461. if (link) {
  462. strncpy(linkname, link->name, len);
  463. tipc_node_unlock(node);
  464. return 0;
  465. }
  466. tipc_node_unlock(node);
  467. return -EINVAL;
  468. }
  469. void tipc_node_unlock(struct tipc_node *node)
  470. {
  471. LIST_HEAD(nsub_list);
  472. LIST_HEAD(conn_sks);
  473. struct sk_buff_head waiting_sks;
  474. u32 addr = 0;
  475. int flags = node->action_flags;
  476. u32 link_id = 0;
  477. if (likely(!flags)) {
  478. spin_unlock_bh(&node->lock);
  479. return;
  480. }
  481. addr = node->addr;
  482. link_id = node->link_id;
  483. __skb_queue_head_init(&waiting_sks);
  484. if (flags & TIPC_WAKEUP_USERS)
  485. skb_queue_splice_init(&node->waiting_sks, &waiting_sks);
  486. if (flags & TIPC_NOTIFY_NODE_DOWN) {
  487. list_replace_init(&node->nsub, &nsub_list);
  488. list_replace_init(&node->conn_sks, &conn_sks);
  489. }
  490. node->action_flags &= ~(TIPC_WAKEUP_USERS | TIPC_NOTIFY_NODE_DOWN |
  491. TIPC_NOTIFY_NODE_UP | TIPC_NOTIFY_LINK_UP |
  492. TIPC_NOTIFY_LINK_DOWN |
  493. TIPC_WAKEUP_BCAST_USERS);
  494. spin_unlock_bh(&node->lock);
  495. while (!skb_queue_empty(&waiting_sks))
  496. tipc_sk_rcv(__skb_dequeue(&waiting_sks));
  497. if (!list_empty(&conn_sks))
  498. tipc_node_abort_sock_conns(&conn_sks);
  499. if (!list_empty(&nsub_list))
  500. tipc_nodesub_notify(&nsub_list);
  501. if (flags & TIPC_WAKEUP_BCAST_USERS)
  502. tipc_bclink_wakeup_users();
  503. if (flags & TIPC_NOTIFY_NODE_UP)
  504. tipc_named_node_up(addr);
  505. if (flags & TIPC_NOTIFY_LINK_UP)
  506. tipc_nametbl_publish(TIPC_LINK_STATE, addr, addr,
  507. TIPC_NODE_SCOPE, link_id, addr);
  508. if (flags & TIPC_NOTIFY_LINK_DOWN)
  509. tipc_nametbl_withdraw(TIPC_LINK_STATE, addr,
  510. link_id, addr);
  511. }