]> err.no Git - linux-2.6/blobdiff - net/tipc/discover.c
tipc: Minor optimizations to received message processing
[linux-2.6] / net / tipc / discover.c
index 5d643e5721eb45ec36d3fb43d2f205e90f1ec5b5..ada213aac4d42e217d62b3d09f323117b472ba1d 100644 (file)
@@ -156,11 +156,11 @@ static void disc_dupl_alert(struct bearer *b_ptr, u32 node_addr,
 /**
  * tipc_disc_recv_msg - handle incoming link setup message (request or response)
  * @buf: buffer containing message
+ * @b_ptr: bearer that message arrived on
  */
 
-void tipc_disc_recv_msg(struct sk_buff *buf)
+void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
 {
-       struct bearer *b_ptr = (struct bearer *)TIPC_SKB_CB(buf)->handle;
        struct link *link;
        struct tipc_media_addr media_addr;
        struct tipc_msg *msg = buf_msg(buf);
@@ -200,9 +200,8 @@ void tipc_disc_recv_msg(struct sk_buff *buf)
                dbg(" in own cluster\n");
                if (n_ptr == NULL) {
                        n_ptr = tipc_node_create(orig);
-               }
-               if (n_ptr == NULL) {
-                       return;
+                       if (!n_ptr)
+                               return;
                }
                spin_lock_bh(&n_ptr->lock);
                link = n_ptr->links[b_ptr->identity];