Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
[linux-2.6-microblaze.git] / net / tipc / bcast.c
index 55aeba6..656ebc7 100644 (file)
@@ -305,17 +305,17 @@ static int tipc_rcast_xmit(struct net *net, struct sk_buff_head *pkts,
  * @skb: socket buffer to copy
  * @method: send method to be used
  * @dests: destination nodes for message.
- * @cong_link_cnt: returns number of encountered congested destination links
  * Returns 0 if success, otherwise errno
  */
 static int tipc_mcast_send_sync(struct net *net, struct sk_buff *skb,
                                struct tipc_mc_method *method,
-                               struct tipc_nlist *dests,
-                               u16 *cong_link_cnt)
+                               struct tipc_nlist *dests)
 {
        struct tipc_msg *hdr, *_hdr;
        struct sk_buff_head tmpq;
        struct sk_buff *_skb;
+       u16 cong_link_cnt;
+       int rc = 0;
 
        /* Is a cluster supporting with new capabilities ? */
        if (!(tipc_net(net)->capabilities & TIPC_MCAST_RBCTL))
@@ -343,18 +343,19 @@ static int tipc_mcast_send_sync(struct net *net, struct sk_buff *skb,
        _hdr = buf_msg(_skb);
        msg_set_size(_hdr, MCAST_H_SIZE);
        msg_set_is_rcast(_hdr, !msg_is_rcast(hdr));
+       msg_set_errcode(_hdr, TIPC_ERR_NO_PORT);
 
        __skb_queue_head_init(&tmpq);
        __skb_queue_tail(&tmpq, _skb);
        if (method->rcast)
-               tipc_bcast_xmit(net, &tmpq, cong_link_cnt);
+               rc = tipc_bcast_xmit(net, &tmpq, &cong_link_cnt);
        else
-               tipc_rcast_xmit(net, &tmpq, dests, cong_link_cnt);
+               rc = tipc_rcast_xmit(net, &tmpq, dests, &cong_link_cnt);
 
        /* This queue should normally be empty by now */
        __skb_queue_purge(&tmpq);
 
-       return 0;
+       return rc;
 }
 
 /* tipc_mcast_xmit - deliver message to indicated destination nodes
@@ -396,9 +397,14 @@ int tipc_mcast_xmit(struct net *net, struct sk_buff_head *pkts,
                msg_set_is_rcast(hdr, method->rcast);
 
                /* Switch method ? */
-               if (rcast != method->rcast)
-                       tipc_mcast_send_sync(net, skb, method,
-                                            dests, cong_link_cnt);
+               if (rcast != method->rcast) {
+                       rc = tipc_mcast_send_sync(net, skb, method, dests);
+                       if (unlikely(rc)) {
+                               pr_err("Unable to send SYN: method %d, rc %d\n",
+                                      rcast, rc);
+                               goto exit;
+                       }
+               }
 
                if (method->rcast)
                        rc = tipc_rcast_xmit(net, pkts, dests, cong_link_cnt);