tipc: Initialize peer session field of newly created link endpoint
[cascardo/linux.git] / net / tipc / link.c
index f89570c..e0bf6d5 100644 (file)
@@ -332,15 +332,16 @@ struct link *tipc_link_create(struct tipc_node *n_ptr,
 
        l_ptr->addr = peer;
        if_name = strchr(b_ptr->name, ':') + 1;
-       sprintf(l_ptr->name, "%u.%u.%u:%s-%u.%u.%u:",
+       sprintf(l_ptr->name, "%u.%u.%u:%s-%u.%u.%u:unknown",
                tipc_zone(tipc_own_addr), tipc_cluster(tipc_own_addr),
                tipc_node(tipc_own_addr),
                if_name,
                tipc_zone(peer), tipc_cluster(peer), tipc_node(peer));
-               /* note: peer i/f is appended to link name by reset/activate */
+               /* note: peer i/f name is updated by reset/activate message */
        memcpy(&l_ptr->media_addr, media_addr, sizeof(*media_addr));
        l_ptr->owner = n_ptr;
        l_ptr->checkpoint = 1;
+       l_ptr->peer_session = INVALID_SESSION;
        l_ptr->b_ptr = b_ptr;
        link_set_supervision_props(l_ptr, b_ptr->media->tolerance);
        l_ptr->state = RESET_UNKNOWN;
@@ -1658,19 +1659,12 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
                        continue;
                }
 
+               /* Discard unicast link messages destined for another node */
+
                if (unlikely(!msg_short(msg) &&
                             (msg_destnode(msg) != tipc_own_addr)))
                        goto cont;
 
-               /* Discard non-routeable messages destined for another node */
-
-               if (unlikely(!msg_isdata(msg) &&
-                            (msg_destnode(msg) != tipc_own_addr))) {
-                       if ((msg_user(msg) != CONN_MANAGER) &&
-                           (msg_user(msg) != MSG_FRAGMENTER))
-                               goto cont;
-               }
-
                /* Locate neighboring node that sent message */
 
                n_ptr = tipc_node_find(msg_prevnode(msg));