Since each endpoint link is sending out a RESET message when it is
going down, it is possible for it to come back up after reboot/interface
cycling by just receiving an ACTIVATE message and continuing by sending
regular traffic. However, after such an event, the local link endpoint
may have been re-created using a new bearer identity, something the peer
endpoints needs to know about in order to create a correct link event
for the users. Traffic messages don't convey this bearer id, so we must
guarantee this by sending a link level STATE message before regular
traffic is started.

In this commit we do this by introducing two small backwards compatible
changes:
1: We register the peer endpoint's bearer id at each STATE message
   reception, not only at RESET and ACTIVATE reception as we do now.
2: We ensure that a STATE message is sent immediately upon a received
   ACTIVATE message.

Although never reported, this problem seems to have always been around.

Signed-off-by: Jon Maloy <jon.ma...@ericsson.com>
---
 net/tipc/link.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index 7d2bb3e..2f55bce 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1415,9 +1415,11 @@ static int tipc_link_proto_rcv(struct tipc_link *l, 
struct sk_buff *skb,
                        rc = tipc_link_fsm_evt(l, LINK_PEER_RESET_EVT);
 
                /* ACTIVATE_MSG takes up link if it was already locally reset */
-               if ((mtyp == ACTIVATE_MSG) && (l->state == LINK_ESTABLISHING))
+               if ((mtyp == ACTIVATE_MSG) && (l->state == LINK_ESTABLISHING)) {
                        rc = TIPC_LINK_UP_EVT;
-
+                       tipc_link_build_proto_msg(l, STATE_MSG, 0,
+                                                 0, 0, 0, xmitq);
+               }
                l->peer_session = msg_session(hdr);
                l->peer_bearer_id = msg_bearer_id(hdr);
                if (l->mtu > msg_max_pkt(hdr))
@@ -1437,6 +1439,7 @@ static int tipc_link_proto_rcv(struct tipc_link *l, 
struct sk_buff *skb,
                }
 
                l->silent_intv_cnt = 0;
+               l->peer_bearer_id = msg_bearer_id(hdr);
                l->stats.recv_states++;
                if (msg_probe(hdr))
                        l->stats.recv_probes++;
-- 
1.9.1


------------------------------------------------------------------------------
_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to