]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/tipc/link.c
tipc: Optimize tipc_node_has_active_links()
[mv-sheeva.git] / net / tipc / link.c
index a3616b99529b72ef1085fe95c99fd972e95e6b93..9d18c9b7638bd879086c9ced39dea5ae22b09486 100644 (file)
@@ -1802,6 +1802,15 @@ static int link_recv_buf_validate(struct sk_buff *buf)
        return pskb_may_pull(buf, hdr_size);
 }
 
+/**
+ * tipc_recv_msg - process TIPC messages arriving from off-node
+ * @head: pointer to message buffer chain
+ * @tb_ptr: pointer to bearer message arrived on
+ *
+ * Invoked with no locks held.  Bearer pointer must point to a valid bearer
+ * structure (i.e. cannot be NULL), but bearer can be inactive.
+ */
+
 void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr)
 {
        read_lock_bh(&tipc_net_lock);
@@ -1819,6 +1828,11 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr)
 
                head = head->next;
 
+               /* Ensure bearer is still enabled */
+
+               if (unlikely(!b_ptr->active))
+                       goto cont;
+
                /* Ensure message is well-formed */
 
                if (unlikely(!link_recv_buf_validate(buf)))