aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/link.c124
-rw-r--r--net/tipc/link.h17
-rw-r--r--net/tipc/msg.c4
-rw-r--r--net/tipc/msg.h10
-rw-r--r--net/tipc/node.c13
5 files changed, 78 insertions, 90 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index c697cf69da91..b1e17953eeea 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -89,17 +89,9 @@ static const struct nla_policy tipc_nl_prop_policy[TIPC_NLA_PROP_MAX + 1] = {
89#define TIMEOUT_EVT 560817u /* link timer expired */ 89#define TIMEOUT_EVT 560817u /* link timer expired */
90 90
91/* 91/*
92 * The following two 'message types' is really just implementation 92 * State value stored in 'failover_pkts'
93 * data conveniently stored in the message header.
94 * They must not be considered part of the protocol
95 */ 93 */
96#define OPEN_MSG 0 94#define FIRST_FAILOVER 0xffffu
97#define CLOSED_MSG 1
98
99/*
100 * State value stored in 'exp_msg_count'
101 */
102#define START_CHANGEOVER 100000u
103 95
104static void link_handle_out_of_seq_msg(struct tipc_link *link, 96static void link_handle_out_of_seq_msg(struct tipc_link *link,
105 struct sk_buff *skb); 97 struct sk_buff *skb);
@@ -113,8 +105,7 @@ static void tipc_link_sync_xmit(struct tipc_link *l);
113static void tipc_link_sync_rcv(struct tipc_node *n, struct sk_buff *buf); 105static void tipc_link_sync_rcv(struct tipc_node *n, struct sk_buff *buf);
114static void tipc_link_input(struct tipc_link *l, struct sk_buff *skb); 106static void tipc_link_input(struct tipc_link *l, struct sk_buff *skb);
115static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb); 107static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb);
116static bool tipc_link_failover_rcv(struct tipc_node *node, 108static bool tipc_link_failover_rcv(struct tipc_link *l, struct sk_buff **skb);
117 struct sk_buff **skb);
118/* 109/*
119 * Simple link routines 110 * Simple link routines
120 */ 111 */
@@ -332,15 +323,19 @@ struct tipc_link *tipc_link_create(struct tipc_node *n_ptr,
332} 323}
333 324
334/** 325/**
335 * link_delete - Conditional deletion of link. 326 * tipc_link_delete - Delete a link
336 * If timer still running, real delete is done when it expires 327 * @l: link to be deleted
337 * @link: link to be deleted
338 */ 328 */
339void tipc_link_delete(struct tipc_link *link) 329void tipc_link_delete(struct tipc_link *l)
340{ 330{
341 tipc_link_reset_fragments(link); 331 tipc_link_reset(l);
342 tipc_node_detach_link(link->owner, link); 332 if (del_timer(&l->timer))
343 tipc_link_put(link); 333 tipc_link_put(l);
334 l->flags |= LINK_STOPPED;
335 /* Delete link now, or when timer is finished: */
336 tipc_link_reset_fragments(l);
337 tipc_node_detach_link(l->owner, l);
338 tipc_link_put(l);
344} 339}
345 340
346void tipc_link_delete_list(struct net *net, unsigned int bearer_id, 341void tipc_link_delete_list(struct net *net, unsigned int bearer_id,
@@ -349,23 +344,12 @@ void tipc_link_delete_list(struct net *net, unsigned int bearer_id,
349 struct tipc_net *tn = net_generic(net, tipc_net_id); 344 struct tipc_net *tn = net_generic(net, tipc_net_id);
350 struct tipc_link *link; 345 struct tipc_link *link;
351 struct tipc_node *node; 346 struct tipc_node *node;
352 bool del_link;
353 347
354 rcu_read_lock(); 348 rcu_read_lock();
355 list_for_each_entry_rcu(node, &tn->node_list, list) { 349 list_for_each_entry_rcu(node, &tn->node_list, list) {
356 tipc_node_lock(node); 350 tipc_node_lock(node);
357 link = node->links[bearer_id]; 351 link = node->links[bearer_id];
358 if (!link) { 352 if (link)
359 tipc_node_unlock(node);
360 continue;
361 }
362 del_link = !tipc_link_is_up(link) && !link->exp_msg_count;
363 tipc_link_reset(link);
364 if (del_timer(&link->timer))
365 tipc_link_put(link);
366 link->flags |= LINK_STOPPED;
367 /* Delete link now, or when failover is finished: */
368 if (shutting_down || !tipc_node_is_up(node) || del_link)
369 tipc_link_delete(link); 353 tipc_link_delete(link);
370 tipc_node_unlock(node); 354 tipc_node_unlock(node);
371 } 355 }
@@ -472,9 +456,9 @@ void tipc_link_purge_queues(struct tipc_link *l_ptr)
472void tipc_link_reset(struct tipc_link *l_ptr) 456void tipc_link_reset(struct tipc_link *l_ptr)
473{ 457{
474 u32 prev_state = l_ptr->state; 458 u32 prev_state = l_ptr->state;
475 u32 checkpoint = l_ptr->next_in_no;
476 int was_active_link = tipc_link_is_active(l_ptr); 459 int was_active_link = tipc_link_is_active(l_ptr);
477 struct tipc_node *owner = l_ptr->owner; 460 struct tipc_node *owner = l_ptr->owner;
461 struct tipc_link *pl = tipc_parallel_link(l_ptr);
478 462
479 msg_set_session(l_ptr->pmsg, ((msg_session(l_ptr->pmsg) + 1) & 0xffff)); 463 msg_set_session(l_ptr->pmsg, ((msg_session(l_ptr->pmsg) + 1) & 0xffff));
480 464
@@ -492,11 +476,15 @@ void tipc_link_reset(struct tipc_link *l_ptr)
492 tipc_node_link_down(l_ptr->owner, l_ptr); 476 tipc_node_link_down(l_ptr->owner, l_ptr);
493 tipc_bearer_remove_dest(owner->net, l_ptr->bearer_id, l_ptr->addr); 477 tipc_bearer_remove_dest(owner->net, l_ptr->bearer_id, l_ptr->addr);
494 478
495 if (was_active_link && tipc_node_active_links(l_ptr->owner)) { 479 if (was_active_link && tipc_node_is_up(l_ptr->owner) && (pl != l_ptr)) {
496 l_ptr->reset_checkpoint = checkpoint; 480 l_ptr->flags |= LINK_FAILINGOVER;
497 l_ptr->exp_msg_count = START_CHANGEOVER; 481 l_ptr->failover_checkpt = l_ptr->next_in_no;
482 pl->failover_pkts = FIRST_FAILOVER;
483 pl->failover_checkpt = l_ptr->next_in_no;
484 pl->failover_skb = l_ptr->reasm_buf;
485 } else {
486 kfree_skb(l_ptr->reasm_buf);
498 } 487 }
499
500 /* Clean up all queues, except inputq: */ 488 /* Clean up all queues, except inputq: */
501 __skb_queue_purge(&l_ptr->transmq); 489 __skb_queue_purge(&l_ptr->transmq);
502 __skb_queue_purge(&l_ptr->deferdq); 490 __skb_queue_purge(&l_ptr->deferdq);
@@ -506,6 +494,7 @@ void tipc_link_reset(struct tipc_link *l_ptr)
506 if (!skb_queue_empty(owner->inputq)) 494 if (!skb_queue_empty(owner->inputq))
507 owner->action_flags |= TIPC_MSG_EVT; 495 owner->action_flags |= TIPC_MSG_EVT;
508 tipc_link_purge_backlog(l_ptr); 496 tipc_link_purge_backlog(l_ptr);
497 l_ptr->reasm_buf = NULL;
509 l_ptr->rcv_unacked = 0; 498 l_ptr->rcv_unacked = 0;
510 l_ptr->checkpoint = 1; 499 l_ptr->checkpoint = 1;
511 l_ptr->next_out_no = 1; 500 l_ptr->next_out_no = 1;
@@ -557,8 +546,7 @@ static void link_state_event(struct tipc_link *l_ptr, unsigned int event)
557 if (!(l_ptr->flags & LINK_STARTED) && (event != STARTING_EVT)) 546 if (!(l_ptr->flags & LINK_STARTED) && (event != STARTING_EVT))
558 return; /* Not yet. */ 547 return; /* Not yet. */
559 548
560 /* Check whether changeover is going on */ 549 if (l_ptr->flags & LINK_FAILINGOVER) {
561 if (l_ptr->exp_msg_count) {
562 if (event == TIMEOUT_EVT) 550 if (event == TIMEOUT_EVT)
563 link_set_timer(l_ptr, cont_intv); 551 link_set_timer(l_ptr, cont_intv);
564 return; 552 return;
@@ -1242,7 +1230,7 @@ static bool tipc_data_input(struct tipc_link *link, struct sk_buff *skb)
1242 node->action_flags |= TIPC_NAMED_MSG_EVT; 1230 node->action_flags |= TIPC_NAMED_MSG_EVT;
1243 return true; 1231 return true;
1244 case MSG_BUNDLER: 1232 case MSG_BUNDLER:
1245 case CHANGEOVER_PROTOCOL: 1233 case TUNNEL_PROTOCOL:
1246 case MSG_FRAGMENTER: 1234 case MSG_FRAGMENTER:
1247 case BCAST_PROTOCOL: 1235 case BCAST_PROTOCOL:
1248 return false; 1236 return false;
@@ -1269,14 +1257,14 @@ static void tipc_link_input(struct tipc_link *link, struct sk_buff *skb)
1269 return; 1257 return;
1270 1258
1271 switch (msg_user(msg)) { 1259 switch (msg_user(msg)) {
1272 case CHANGEOVER_PROTOCOL: 1260 case TUNNEL_PROTOCOL:
1273 if (msg_dup(msg)) { 1261 if (msg_dup(msg)) {
1274 link->flags |= LINK_SYNCHING; 1262 link->flags |= LINK_SYNCHING;
1275 link->synch_point = msg_seqno(msg_get_wrapped(msg)); 1263 link->synch_point = msg_seqno(msg_get_wrapped(msg));
1276 kfree_skb(skb); 1264 kfree_skb(skb);
1277 break; 1265 break;
1278 } 1266 }
1279 if (!tipc_link_failover_rcv(node, &skb)) 1267 if (!tipc_link_failover_rcv(link, &skb))
1280 break; 1268 break;
1281 if (msg_user(buf_msg(skb)) != MSG_BUNDLER) { 1269 if (msg_user(buf_msg(skb)) != MSG_BUNDLER) {
1282 tipc_data_input(link, skb); 1270 tipc_data_input(link, skb);
@@ -1391,8 +1379,8 @@ void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int probe_msg,
1391 u32 msg_size = sizeof(l_ptr->proto_msg); 1379 u32 msg_size = sizeof(l_ptr->proto_msg);
1392 int r_flag; 1380 int r_flag;
1393 1381
1394 /* Don't send protocol message during link changeover */ 1382 /* Don't send protocol message during link failover */
1395 if (l_ptr->exp_msg_count) 1383 if (l_ptr->flags & LINK_FAILINGOVER)
1396 return; 1384 return;
1397 1385
1398 /* Abort non-RESET send if communication with node is prohibited */ 1386 /* Abort non-RESET send if communication with node is prohibited */
@@ -1444,7 +1432,7 @@ void tipc_link_proto_xmit(struct tipc_link *l_ptr, u32 msg_typ, int probe_msg,
1444 } 1432 }
1445 l_ptr->stats.sent_states++; 1433 l_ptr->stats.sent_states++;
1446 } else { /* RESET_MSG or ACTIVATE_MSG */ 1434 } else { /* RESET_MSG or ACTIVATE_MSG */
1447 msg_set_ack(msg, mod(l_ptr->reset_checkpoint - 1)); 1435 msg_set_ack(msg, mod(l_ptr->failover_checkpt - 1));
1448 msg_set_seq_gap(msg, 0); 1436 msg_set_seq_gap(msg, 0);
1449 msg_set_next_sent(msg, 1); 1437 msg_set_next_sent(msg, 1);
1450 msg_set_probe(msg, 0); 1438 msg_set_probe(msg, 0);
@@ -1486,8 +1474,7 @@ static void tipc_link_proto_rcv(struct tipc_link *l_ptr,
1486 u32 msg_tol; 1474 u32 msg_tol;
1487 struct tipc_msg *msg = buf_msg(buf); 1475 struct tipc_msg *msg = buf_msg(buf);
1488 1476
1489 /* Discard protocol message during link changeover */ 1477 if (l_ptr->flags & LINK_FAILINGOVER)
1490 if (l_ptr->exp_msg_count)
1491 goto exit; 1478 goto exit;
1492 1479
1493 if (l_ptr->net_plane != msg_net_plane(msg)) 1480 if (l_ptr->net_plane != msg_net_plane(msg))
@@ -1659,8 +1646,8 @@ void tipc_link_failover_send_queue(struct tipc_link *l_ptr)
1659 if (!tunnel) 1646 if (!tunnel)
1660 return; 1647 return;
1661 1648
1662 tipc_msg_init(link_own_addr(l_ptr), &tunnel_hdr, CHANGEOVER_PROTOCOL, 1649 tipc_msg_init(link_own_addr(l_ptr), &tunnel_hdr, TUNNEL_PROTOCOL,
1663 ORIGINAL_MSG, INT_H_SIZE, l_ptr->addr); 1650 FAILOVER_MSG, INT_H_SIZE, l_ptr->addr);
1664 skb_queue_splice_tail_init(&l_ptr->backlogq, &l_ptr->transmq); 1651 skb_queue_splice_tail_init(&l_ptr->backlogq, &l_ptr->transmq);
1665 tipc_link_purge_backlog(l_ptr); 1652 tipc_link_purge_backlog(l_ptr);
1666 msgcount = skb_queue_len(&l_ptr->transmq); 1653 msgcount = skb_queue_len(&l_ptr->transmq);
@@ -1722,8 +1709,8 @@ void tipc_link_dup_queue_xmit(struct tipc_link *link,
1722 struct sk_buff_head *queue = &link->transmq; 1709 struct sk_buff_head *queue = &link->transmq;
1723 int mcnt; 1710 int mcnt;
1724 1711
1725 tipc_msg_init(link_own_addr(link), &tnl_hdr, CHANGEOVER_PROTOCOL, 1712 tipc_msg_init(link_own_addr(link), &tnl_hdr, TUNNEL_PROTOCOL,
1726 DUPLICATE_MSG, INT_H_SIZE, link->addr); 1713 SYNCH_MSG, INT_H_SIZE, link->addr);
1727 mcnt = skb_queue_len(&link->transmq) + skb_queue_len(&link->backlogq); 1714 mcnt = skb_queue_len(&link->transmq) + skb_queue_len(&link->backlogq);
1728 msg_set_msgcnt(&tnl_hdr, mcnt); 1715 msg_set_msgcnt(&tnl_hdr, mcnt);
1729 msg_set_bearer_id(&tnl_hdr, link->peer_bearer_id); 1716 msg_set_bearer_id(&tnl_hdr, link->peer_bearer_id);
@@ -1756,36 +1743,37 @@ tunnel_queue:
1756 goto tunnel_queue; 1743 goto tunnel_queue;
1757} 1744}
1758 1745
1759/* tipc_link_failover_rcv(): Receive a tunnelled ORIGINAL_MSG packet 1746/* tipc_link_failover_rcv(): Receive a tunnelled FAILOVER_MSG packet
1760 * Owner node is locked. 1747 * Owner node is locked.
1761 */ 1748 */
1762static bool tipc_link_failover_rcv(struct tipc_node *node, 1749static bool tipc_link_failover_rcv(struct tipc_link *link,
1763 struct sk_buff **skb) 1750 struct sk_buff **skb)
1764{ 1751{
1765 struct tipc_msg *msg = buf_msg(*skb); 1752 struct tipc_msg *msg = buf_msg(*skb);
1766 struct sk_buff *iskb = NULL; 1753 struct sk_buff *iskb = NULL;
1767 struct tipc_link *link = NULL; 1754 struct tipc_link *pl = NULL;
1768 int bearer_id = msg_bearer_id(msg); 1755 int bearer_id = msg_bearer_id(msg);
1769 int pos = 0; 1756 int pos = 0;
1770 1757
1771 if (msg_type(msg) != ORIGINAL_MSG) { 1758 if (msg_type(msg) != FAILOVER_MSG) {
1772 pr_warn("%sunknown tunnel pkt received\n", link_co_err); 1759 pr_warn("%sunknown tunnel pkt received\n", link_co_err);
1773 goto exit; 1760 goto exit;
1774 } 1761 }
1775 if (bearer_id >= MAX_BEARERS) 1762 if (bearer_id >= MAX_BEARERS)
1776 goto exit; 1763 goto exit;
1777 link = node->links[bearer_id]; 1764
1778 if (!link) 1765 if (bearer_id == link->bearer_id)
1779 goto exit; 1766 goto exit;
1780 if (tipc_link_is_up(link))
1781 tipc_link_reset(link);
1782 1767
1783 /* First failover packet? */ 1768 pl = link->owner->links[bearer_id];
1784 if (link->exp_msg_count == START_CHANGEOVER) 1769 if (pl && tipc_link_is_up(pl))
1785 link->exp_msg_count = msg_msgcnt(msg); 1770 tipc_link_reset(pl);
1771
1772 if (link->failover_pkts == FIRST_FAILOVER)
1773 link->failover_pkts = msg_msgcnt(msg);
1786 1774
1787 /* Should we expect an inner packet? */ 1775 /* Should we expect an inner packet? */
1788 if (!link->exp_msg_count) 1776 if (!link->failover_pkts)
1789 goto exit; 1777 goto exit;
1790 1778
1791 if (!tipc_msg_extract(*skb, &iskb, &pos)) { 1779 if (!tipc_msg_extract(*skb, &iskb, &pos)) {
@@ -1793,22 +1781,22 @@ static bool tipc_link_failover_rcv(struct tipc_node *node,
1793 *skb = NULL; 1781 *skb = NULL;
1794 goto exit; 1782 goto exit;
1795 } 1783 }
1796 link->exp_msg_count--; 1784 link->failover_pkts--;
1797 *skb = NULL; 1785 *skb = NULL;
1798 1786
1799 /* Was packet already delivered? */ 1787 /* Was this packet already delivered? */
1800 if (less(buf_seqno(iskb), link->reset_checkpoint)) { 1788 if (less(buf_seqno(iskb), link->failover_checkpt)) {
1801 kfree_skb(iskb); 1789 kfree_skb(iskb);
1802 iskb = NULL; 1790 iskb = NULL;
1803 goto exit; 1791 goto exit;
1804 } 1792 }
1805 if (msg_user(buf_msg(iskb)) == MSG_FRAGMENTER) { 1793 if (msg_user(buf_msg(iskb)) == MSG_FRAGMENTER) {
1806 link->stats.recv_fragments++; 1794 link->stats.recv_fragments++;
1807 tipc_buf_append(&link->reasm_buf, &iskb); 1795 tipc_buf_append(&link->failover_skb, &iskb);
1808 } 1796 }
1809exit: 1797exit:
1810 if (link && (!link->exp_msg_count) && (link->flags & LINK_STOPPED)) 1798 if (!link->failover_pkts && pl)
1811 tipc_link_delete(link); 1799 pl->flags &= ~LINK_FAILINGOVER;
1812 kfree_skb(*skb); 1800 kfree_skb(*skb);
1813 *skb = iskb; 1801 *skb = iskb;
1814 return *skb; 1802 return *skb;
diff --git a/net/tipc/link.h b/net/tipc/link.h
index d2b5663643da..6e28f03c7905 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -58,9 +58,10 @@
58 58
59/* Link endpoint execution states 59/* Link endpoint execution states
60 */ 60 */
61#define LINK_STARTED 0x0001 61#define LINK_STARTED 0x0001
62#define LINK_STOPPED 0x0002 62#define LINK_STOPPED 0x0002
63#define LINK_SYNCHING 0x0004 63#define LINK_SYNCHING 0x0004
64#define LINK_FAILINGOVER 0x0008
64 65
65/* Starting value for maximum packet size negotiation on unicast links 66/* Starting value for maximum packet size negotiation on unicast links
66 * (unless bearer MTU is less) 67 * (unless bearer MTU is less)
@@ -167,11 +168,12 @@ struct tipc_link {
167 struct tipc_msg *pmsg; 168 struct tipc_msg *pmsg;
168 u32 priority; 169 u32 priority;
169 char net_plane; 170 char net_plane;
171 u16 synch_point;
170 172
171 /* Changeover */ 173 /* Failover */
172 u32 exp_msg_count; 174 u16 failover_pkts;
173 u32 reset_checkpoint; 175 u16 failover_checkpt;
174 u32 synch_point; 176 struct sk_buff *failover_skb;
175 177
176 /* Max packet negotiation */ 178 /* Max packet negotiation */
177 u32 max_pkt; 179 u32 max_pkt;
@@ -201,7 +203,6 @@ struct tipc_link {
201 struct sk_buff_head wakeupq; 203 struct sk_buff_head wakeupq;
202 204
203 /* Fragmentation/reassembly */ 205 /* Fragmentation/reassembly */
204 u32 long_msg_seq_no;
205 struct sk_buff *reasm_buf; 206 struct sk_buff *reasm_buf;
206 207
207 /* Statistics */ 208 /* Statistics */
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 3bb499c61918..c3e96e815418 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -355,7 +355,7 @@ bool tipc_msg_bundle(struct sk_buff *bskb, struct sk_buff *skb, u32 mtu)
355 start = align(bsz); 355 start = align(bsz);
356 pad = start - bsz; 356 pad = start - bsz;
357 357
358 if (unlikely(msg_user(msg) == CHANGEOVER_PROTOCOL)) 358 if (unlikely(msg_user(msg) == TUNNEL_PROTOCOL))
359 return false; 359 return false;
360 if (unlikely(msg_user(msg) == BCAST_PROTOCOL)) 360 if (unlikely(msg_user(msg) == BCAST_PROTOCOL))
361 return false; 361 return false;
@@ -433,7 +433,7 @@ bool tipc_msg_make_bundle(struct sk_buff **skb, u32 mtu, u32 dnode)
433 433
434 if (msg_user(msg) == MSG_FRAGMENTER) 434 if (msg_user(msg) == MSG_FRAGMENTER)
435 return false; 435 return false;
436 if (msg_user(msg) == CHANGEOVER_PROTOCOL) 436 if (msg_user(msg) == TUNNEL_PROTOCOL)
437 return false; 437 return false;
438 if (msg_user(msg) == BCAST_PROTOCOL) 438 if (msg_user(msg) == BCAST_PROTOCOL)
439 return false; 439 return false;
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index d273207ede28..e1d3595e2ee9 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -72,7 +72,7 @@ struct plist;
72#define MSG_BUNDLER 6 72#define MSG_BUNDLER 6
73#define LINK_PROTOCOL 7 73#define LINK_PROTOCOL 7
74#define CONN_MANAGER 8 74#define CONN_MANAGER 8
75#define CHANGEOVER_PROTOCOL 10 75#define TUNNEL_PROTOCOL 10
76#define NAME_DISTRIBUTOR 11 76#define NAME_DISTRIBUTOR 11
77#define MSG_FRAGMENTER 12 77#define MSG_FRAGMENTER 12
78#define LINK_CONFIG 13 78#define LINK_CONFIG 13
@@ -512,8 +512,8 @@ static inline void msg_set_nameupper(struct tipc_msg *m, u32 n)
512/* 512/*
513 * Changeover tunnel message types 513 * Changeover tunnel message types
514 */ 514 */
515#define DUPLICATE_MSG 0 515#define SYNCH_MSG 0
516#define ORIGINAL_MSG 1 516#define FAILOVER_MSG 1
517 517
518/* 518/*
519 * Config protocol message types 519 * Config protocol message types
@@ -556,9 +556,9 @@ static inline void msg_set_node_capabilities(struct tipc_msg *m, u32 n)
556 556
557static inline bool msg_dup(struct tipc_msg *m) 557static inline bool msg_dup(struct tipc_msg *m)
558{ 558{
559 if (likely(msg_user(m) != CHANGEOVER_PROTOCOL)) 559 if (likely(msg_user(m) != TUNNEL_PROTOCOL))
560 return false; 560 return false;
561 if (msg_type(m) != DUPLICATE_MSG) 561 if (msg_type(m) != SYNCH_MSG)
562 return false; 562 return false;
563 return true; 563 return true;
564} 564}
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 3e4f04897c03..f3d522c2881a 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -394,18 +394,17 @@ static void node_lost_contact(struct tipc_node *n_ptr)
394 n_ptr->bclink.recv_permitted = false; 394 n_ptr->bclink.recv_permitted = false;
395 } 395 }
396 396
397 /* Abort link changeover */ 397 /* Abort any ongoing link failover */
398 for (i = 0; i < MAX_BEARERS; i++) { 398 for (i = 0; i < MAX_BEARERS; i++) {
399 struct tipc_link *l_ptr = n_ptr->links[i]; 399 struct tipc_link *l_ptr = n_ptr->links[i];
400 if (!l_ptr) 400 if (!l_ptr)
401 continue; 401 continue;
402 l_ptr->reset_checkpoint = l_ptr->next_in_no; 402 l_ptr->flags &= ~LINK_FAILINGOVER;
403 l_ptr->exp_msg_count = 0; 403 l_ptr->failover_checkpt = 0;
404 l_ptr->failover_pkts = 0;
405 kfree_skb(l_ptr->failover_skb);
406 l_ptr->failover_skb = NULL;
404 tipc_link_reset_fragments(l_ptr); 407 tipc_link_reset_fragments(l_ptr);
405
406 /* Link marked for deletion after failover? => do it now */
407 if (l_ptr->flags & LINK_STOPPED)
408 tipc_link_delete(l_ptr);
409 } 408 }
410 409
411 n_ptr->action_flags &= ~TIPC_WAIT_OWN_LINKS_DOWN; 410 n_ptr->action_flags &= ~TIPC_WAIT_OWN_LINKS_DOWN;