tipc: change sk_buffer handling in tipc_link_xmit()
[cascardo/linux.git] / net / tipc / bcast.c
index 4906ca3..295bdc2 100644 (file)
@@ -108,6 +108,11 @@ void tipc_bclink_remove_node(struct net *net, u32 addr)
 
        tipc_bclink_lock(net);
        tipc_nmap_remove(&tn->bclink->bcast_nodes, addr);
+
+       /* Last node? => reset backlog queue */
+       if (!tn->bclink->bcast_nodes.count)
+               tipc_link_purge_backlog(&tn->bclink->link);
+
        tipc_bclink_unlock(net);
 }
 
@@ -353,10 +358,9 @@ int tipc_bclink_xmit(struct net *net, struct sk_buff_head *list)
 
        /* Prepare clone of message for local node */
        skb = tipc_msg_reassemble(list);
-       if (unlikely(!skb)) {
-               __skb_queue_purge(list);
+       if (unlikely(!skb))
                return -EHOSTUNREACH;
-       }
+
        /* Broadcast to all nodes */
        if (likely(bclink)) {
                tipc_bclink_lock(net);
@@ -408,7 +412,7 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno)
         * all nodes in the cluster don't ACK at the same time
         */
        if (((seqno - tn->own_addr) % TIPC_MIN_LINK_WIN) == 0) {
-               tipc_link_proto_xmit(node->active_links[node->addr & 1],
+               tipc_link_proto_xmit(node_active_link(node, node->addr),
                                     STATE_MSG, 0, 0, 0, 0);
                tn->bcl->stats.sent_acks++;
        }