tipc: Add missing broadcast link lock when sending NACK
authorAllan Stephens <allan.stephens@windriver.com>
Wed, 26 Oct 2011 15:41:45 +0000 (11:41 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 6 Feb 2012 21:59:17 +0000 (16:59 -0500)
Ensures that any attempt to send a NACK message over TIPC's broadcast
link has exclusive access to the link's main data structures, to prevent
interference with a simultaneous attempt to send other broadcast link
traffic (such as application-generated multicast messages).

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/tipc/bcast.c

index 8eb87b11d10050f7497498e4776064b39c216be9..7342abc2cfa1bdd08a1a2e7abc51acb396ce4ab5 100644 (file)
@@ -340,8 +340,10 @@ static void bclink_send_nack(struct tipc_node *n_ptr)
                msg_set_bcgap_to(msg, n_ptr->bclink.gap_to);
                msg_set_bcast_tag(msg, tipc_own_tag);
 
+               spin_lock_bh(&bc_lock);
                tipc_bearer_send(&bcbearer->bearer, buf, NULL);
                bcl->stats.sent_nacks++;
+               spin_unlock_bh(&bc_lock);
                buf_discard(buf);
 
                /*