diff options
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 1c514b64a0a9..f5cd986e1e50 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -1705,6 +1705,41 @@ tnl: | |||
1705 | } | 1705 | } |
1706 | } | 1706 | } |
1707 | 1707 | ||
1708 | /** | ||
1709 | * tipc_link_failover_prepare() - prepare tnl for link failover | ||
1710 | * | ||
1711 | * This is a special version of the precursor - tipc_link_tnl_prepare(), | ||
1712 | * see the tipc_node_link_failover() for details | ||
1713 | * | ||
1714 | * @l: failover link | ||
1715 | * @tnl: tunnel link | ||
1716 | * @xmitq: queue for messages to be xmited | ||
1717 | */ | ||
1718 | void tipc_link_failover_prepare(struct tipc_link *l, struct tipc_link *tnl, | ||
1719 | struct sk_buff_head *xmitq) | ||
1720 | { | ||
1721 | struct sk_buff_head *fdefq = &tnl->failover_deferdq; | ||
1722 | |||
1723 | tipc_link_create_dummy_tnl_msg(tnl, xmitq); | ||
1724 | |||
1725 | /* This failover link enpoint was never established before, | ||
1726 | * so it has not received anything from peer. | ||
1727 | * Otherwise, it must be a normal failover situation or the | ||
1728 | * node has entered SELF_DOWN_PEER_LEAVING and both peer nodes | ||
1729 | * would have to start over from scratch instead. | ||
1730 | */ | ||
1731 | WARN_ON(l && tipc_link_is_up(l)); | ||
1732 | tnl->drop_point = 1; | ||
1733 | tnl->failover_reasm_skb = NULL; | ||
1734 | |||
1735 | /* Initiate the link's failover deferdq */ | ||
1736 | if (unlikely(!skb_queue_empty(fdefq))) { | ||
1737 | pr_warn("Link failover deferdq not empty: %d!\n", | ||
1738 | skb_queue_len(fdefq)); | ||
1739 | __skb_queue_purge(fdefq); | ||
1740 | } | ||
1741 | } | ||
1742 | |||
1708 | /* tipc_link_validate_msg(): validate message against current link state | 1743 | /* tipc_link_validate_msg(): validate message against current link state |
1709 | * Returns true if message should be accepted, otherwise false | 1744 | * Returns true if message should be accepted, otherwise false |
1710 | */ | 1745 | */ |