aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/link.c17
-rw-r--r--net/tipc/link.h1
-rw-r--r--net/tipc/node.c6
3 files changed, 8 insertions, 16 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index cc40aa6eb66c..05837ba7b68c 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -228,6 +228,8 @@ struct tipc_link *tipc_link_create(struct tipc_node *n_ptr,
228 l_ptr->peer_session = WILDCARD_SESSION; 228 l_ptr->peer_session = WILDCARD_SESSION;
229 l_ptr->bearer_id = b_ptr->identity; 229 l_ptr->bearer_id = b_ptr->identity;
230 l_ptr->tolerance = b_ptr->tolerance; 230 l_ptr->tolerance = b_ptr->tolerance;
231 l_ptr->snd_nxt = 1;
232 l_ptr->rcv_nxt = 1;
231 l_ptr->state = TIPC_LINK_RESETTING; 233 l_ptr->state = TIPC_LINK_RESETTING;
232 234
233 l_ptr->pmsg = (struct tipc_msg *)&l_ptr->proto_msg; 235 l_ptr->pmsg = (struct tipc_msg *)&l_ptr->proto_msg;
@@ -376,6 +378,7 @@ static int tipc_link_fsm_evt(struct tipc_link *l, int evt,
376 pl = node_active_link(l->owner, 0); 378 pl = node_active_link(l->owner, 0);
377 if (pl && link_probing(pl)) 379 if (pl && link_probing(pl))
378 break; 380 break;
381 l->state = TIPC_LINK_WORKING;
379 actions |= LINK_ACTIVATE; 382 actions |= LINK_ACTIVATE;
380 if (!l->owner->working_links) 383 if (!l->owner->working_links)
381 actions |= SND_BCAST_SYNC; 384 actions |= SND_BCAST_SYNC;
@@ -398,6 +401,7 @@ static int tipc_link_fsm_evt(struct tipc_link *l, int evt,
398 pl = node_active_link(l->owner, 0); 401 pl = node_active_link(l->owner, 0);
399 if (pl && link_probing(pl)) 402 if (pl && link_probing(pl))
400 break; 403 break;
404 l->state = TIPC_LINK_WORKING;
401 actions |= LINK_ACTIVATE; 405 actions |= LINK_ACTIVATE;
402 if (!l->owner->working_links) 406 if (!l->owner->working_links)
403 actions |= SND_BCAST_SYNC; 407 actions |= SND_BCAST_SYNC;
@@ -639,19 +643,6 @@ void tipc_link_reset(struct tipc_link *l_ptr)
639 link_reset_statistics(l_ptr); 643 link_reset_statistics(l_ptr);
640} 644}
641 645
642void tipc_link_activate(struct tipc_link *link)
643{
644 struct tipc_node *node = link->owner;
645
646 link->rcv_nxt = 1;
647 link->stats.recv_info = 1;
648 link->silent_intv_cnt = 0;
649 link->state = TIPC_LINK_WORKING;
650 link->exec_mode = TIPC_LINK_OPEN;
651 tipc_node_link_up(node, link->bearer_id);
652 tipc_bearer_add_dest(node->net, link->bearer_id, link->addr);
653}
654
655/** 646/**
656 * __tipc_link_xmit(): same as tipc_link_xmit, but destlink is known & locked 647 * __tipc_link_xmit(): same as tipc_link_xmit, but destlink is known & locked
657 * @link: link to use 648 * @link: link to use
diff --git a/net/tipc/link.h b/net/tipc/link.h
index 37cfd7d7bf7d..279196d6baac 100644
--- a/net/tipc/link.h
+++ b/net/tipc/link.h
@@ -223,7 +223,6 @@ void tipc_link_purge_queues(struct tipc_link *l_ptr);
223void tipc_link_purge_backlog(struct tipc_link *l); 223void tipc_link_purge_backlog(struct tipc_link *l);
224void tipc_link_reset_all(struct tipc_node *node); 224void tipc_link_reset_all(struct tipc_node *node);
225void tipc_link_reset(struct tipc_link *l_ptr); 225void tipc_link_reset(struct tipc_link *l_ptr);
226void tipc_link_activate(struct tipc_link *link);
227int __tipc_link_xmit(struct net *net, struct tipc_link *link, 226int __tipc_link_xmit(struct net *net, struct tipc_link *link,
228 struct sk_buff_head *list); 227 struct sk_buff_head *list);
229int tipc_link_xmit(struct tipc_link *link, struct sk_buff_head *list, 228int tipc_link_xmit(struct tipc_link *link, struct sk_buff_head *list,
diff --git a/net/tipc/node.c b/net/tipc/node.c
index e92f84afbf95..558df25a7fc6 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -295,11 +295,13 @@ void tipc_node_link_up(struct tipc_node *n, int bearer_id)
295 n->action_flags |= TIPC_NOTIFY_LINK_UP; 295 n->action_flags |= TIPC_NOTIFY_LINK_UP;
296 n->link_id = l->peer_bearer_id << 16 | l->bearer_id; 296 n->link_id = l->peer_bearer_id << 16 | l->bearer_id;
297 297
298 tipc_bearer_add_dest(n->net, bearer_id, n->addr);
299
298 pr_debug("Established link <%s> on network plane %c\n", 300 pr_debug("Established link <%s> on network plane %c\n",
299 l->name, l->net_plane); 301 l->name, l->net_plane);
300 302
301 /* No active links ? => take both active slots */ 303 /* No active links ? => take both active slots */
302 if (*slot0 < 0) { 304 if (!tipc_node_is_up(n)) {
303 *slot0 = bearer_id; 305 *slot0 = bearer_id;
304 *slot1 = bearer_id; 306 *slot1 = bearer_id;
305 node_established_contact(n); 307 node_established_contact(n);
@@ -896,7 +898,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)
896 rc = tipc_link_rcv(l, skb, &xmitq); 898 rc = tipc_link_rcv(l, skb, &xmitq);
897 899
898 if (unlikely(rc & TIPC_LINK_UP_EVT)) 900 if (unlikely(rc & TIPC_LINK_UP_EVT))
899 tipc_link_activate(l); 901 tipc_node_link_up(n, bearer_id);
900 if (unlikely(rc & TIPC_LINK_DOWN_EVT)) 902 if (unlikely(rc & TIPC_LINK_DOWN_EVT))
901 tipc_link_reset(l); 903 tipc_link_reset(l);
902 skb = NULL; 904 skb = NULL;