Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-microblaze.git] / net / tipc / bcast.c
index 55aeba6..4c20be0 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);
@@ -562,18 +568,18 @@ int tipc_bclink_reset_stats(struct net *net)
        return 0;
 }
 
-static int tipc_bc_link_set_queue_limits(struct net *net, u32 limit)
+static int tipc_bc_link_set_queue_limits(struct net *net, u32 max_win)
 {
        struct tipc_link *l = tipc_bc_sndlink(net);
 
        if (!l)
                return -ENOPROTOOPT;
-       if (limit < BCLINK_WIN_MIN)
-               limit = BCLINK_WIN_MIN;
-       if (limit > TIPC_MAX_LINK_WIN)
+       if (max_win < BCLINK_WIN_MIN)
+               max_win = BCLINK_WIN_MIN;
+       if (max_win > TIPC_MAX_LINK_WIN)
                return -EINVAL;
        tipc_bcast_lock(net);
-       tipc_link_set_queue_limits(l, limit);
+       tipc_link_set_queue_limits(l, BCLINK_WIN_MIN, max_win);
        tipc_bcast_unlock(net);
        return 0;
 }
@@ -683,6 +689,7 @@ int tipc_bcast_init(struct net *net)
        if (!tipc_link_bc_create(net, 0, 0,
                                 FB_MTU,
                                 BCLINK_WIN_DEFAULT,
+                                BCLINK_WIN_DEFAULT,
                                 0,
                                 &bb->inputq,
                                 NULL,